Nomi Posted August 5, 2020 Share Posted August 5, 2020 Hi all, Coding question for those who write their own nodes. Every time I try to run a node with the (a,b) = vs.TrueTypeToPoly(text) the program crashes - has anyone run into this/has any suggestions? I've attached a simple sample node that creates text and then uses the above command to turn it into poly lines. It doesn't crash if I don't try to assign the output to the tuple (a,b), but also doesn't convert the text. Thanks, Naomi text test.vwx Quote Link to comment
Pat Stanford Posted August 6, 2020 Share Posted August 6, 2020 TrueTypeToPoly take a handle pointing to the text name a block of text as a parameter. This seems to run: (a,b) = vs.TrueTypeToPoly(vs.FSActLayer()) This creates a group containing the polygonized text. You probably need a vs.Redraw or RedrawAll to get the display right. Be careful about passing a nil handle. When I did it crashed VW to the finder. HTH Quote Link to comment
Nomi Posted August 6, 2020 Author Share Posted August 6, 2020 Aha, didn't know there were different ways to grab the handle for the created text. The node would run once but crash on the second time for some reason with (a,b) = vs.TrueTypeToPoly(vs.FSActLayer()). Did some playing, this combination seems to be the winner: text = vs.CreateText('hello') (a,b) = vs.TrueTypeToPoly(vs.LNewObj() ) self.Params.out.value = b Thanks! Naomi Quote Link to comment
Pat Stanford Posted August 6, 2020 Share Posted August 6, 2020 Great! There are lots of different ways to get handles to objects and if you are going to do much scripting, handles are one of the most important aspects of PythonScript (VectorScript) to wrap your head around. Ask again if you need more help. 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.