NeonClear Posted May 16, 2016 Share Posted May 16, 2016 (edited) I'm working on a marionette script that can do the following Take dimension inputs. Make a shape base on those inputs. Make a text box next to the shape with the dimensions and other specifications. I'm having trouble converting the dimension value into a string. Does anybody know of an easy way to do this? Here's what I've tried so far. I've attempted to make a node for VS.Num2StrF but I'm not having any luck. If I hard code the value directly into the function it works. vs.Num2StrF(12.000000000000002) If I try to pass a variable, then it doesn't work. Am I making a simple mistake? vs.Num2StrF(self.Params.dim.value) Edited May 16, 2016 by NeonClear Quote Link to comment
Marionette Maven Marissa Farrell Posted May 16, 2016 Marionette Maven Share Posted May 16, 2016 Brendan, You should just be able to use str(self.Params.dim.value) Quote Link to comment
Marionette Maven Marissa Farrell Posted May 16, 2016 Marionette Maven Share Posted May 16, 2016 Also, the nodes in the "Text" category should already convert the values to strings before creating the text objects, if you plan to use those. Quote Link to comment
NeonClear Posted May 16, 2016 Author Share Posted May 16, 2016 If I try either of those, I get "12.000000000000002" and not " 1'0" ". Quote Link to comment
Marionette Maven Marissa Farrell Posted May 16, 2016 Marionette Maven Share Posted May 16, 2016 Try the node in this file. I think I misunderstood you initially. Quote Link to comment
NeonClear Posted May 16, 2016 Author Share Posted May 16, 2016 Fantastic! Exactly what I needed. Thank you so much! Quote Link to comment
Marionette Maven Marissa Farrell Posted May 16, 2016 Marionette Maven Share Posted May 16, 2016 Just to follow up - I think the issue with your node is only that you included "SetListAbsorb()". When I took that out, your node ran for me. Quote Link to comment
NeonClear Posted May 16, 2016 Author Share Posted May 16, 2016 Ahhhh, the dangers of copy and paste. Darn it. Thank you very much. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.