Kevin McAllister Posted September 18, 2015 Share Posted September 18, 2015 (edited) I've had a lot of trouble getting an object to rotate using the Transform2 or Rotate Nodes. The documentation is confusing about what's needed (angle, vector, point) to make this happen. In fact, I can consistently get VW to crash using the setup in this file. All you need to do is enter the node and then exit again. I wish the node descriptions about what's needed were clearer. I've found myself looking at the code and referencing the Vectorworks Developer wiki to try and figure it out. This sort of defeats the purpose of visual scripting. I also wish any unconnected input showed up as a field in the OIP for a given node (ie. for the Rotate or Transform2 nodes in this case). That way if I wanted to set a constant value or initial value I could set it there but it wouldn't be a field in the Wrapper OIP. I couldn't find an input node that was a hidden input (ie. didn't show up in the OIP) Any help getting this rotation to work would be appreciated. It seems like it should be a simple thing. Kevin Edit, the forum won't let me add a file. Its currently telling me the maximum file size is 1 Byte. I suspect its broken..... Edited September 18, 2015 by Kevin McAllister Quote Link to comment
Vectorworks, Inc Employee PVA - Admin Posted September 18, 2015 Vectorworks, Inc Employee Share Posted September 18, 2015 Unconnected nodes can't default to input fields unfortunately, since most connections can take multiple input node types. Allowing it to "guess" is too dangerous, but thats just the nature of programming in general. Documentation is coming, just didn't get wrapped up in time for release. Im head down making materials for it right now as are some of the engineers. the forum won't let me add a file. Its currently telling me the maximum file size is 1 Byte. I suspect its broken..... Should be fixed now, please try again and let me know, worked on my end but I have a different permission set. Quote Link to comment
Vectorworks, Inc Employee PVA - Admin Posted September 18, 2015 Vectorworks, Inc Employee Share Posted September 18, 2015 For rotating objects, my tutorial actually covers that specifically, it should be done next week. If i can snip out an excerpt before that I will if someone else isnt able to answer here first. Quote Link to comment
Kevin McAllister Posted September 18, 2015 Author Share Posted September 18, 2015 Unconnected nodes can't default to input fields unfortunately, since most connections can take multiple input node types. Allowing it to "guess" is too dangerous, but thats just the nature of programming in general. Makes sense. Is there a node for setting a default value then, one that doesn't show up as a field in the OIP (like a user definable Pi type node)? Documentation is coming, just didn't get wrapped up in time for release. Im head down making materials for it right now as are some of the engineers. We're all just too excited to wait :-) Forum upload is working as expected again. Thank you! I've attached my file. For anyone who downloads it be aware that as soon as you enter and exit the Marionette Object it will crash VW. Kevin Quote Link to comment
Mark Flamer Posted September 18, 2015 Share Posted September 18, 2015 I can't duplicate the crash here, but I do see the rotate problem and am fixing it. It is only a problem when rotating a planar object inside of a Marionette object. If you rotate the extrude instead it should work. Please let me know if anyone else is getting a crash with this file. Sorry for the inconvenience. Quote Link to comment
Vectorworks, Inc Employee SBarrettWalker Posted September 18, 2015 Vectorworks, Inc Employee Share Posted September 18, 2015 Mark I am also getting a crash with this file - however if I convert the marionette object to a wrapper, it works without crashing. Quote Link to comment
Mark Flamer Posted September 18, 2015 Share Posted September 18, 2015 Ah, both on mac. OK, probably a mac only problem. I'll fire up the mac and see whats up. Thanks. Quote Link to comment
Kevin McAllister Posted September 18, 2015 Author Share Posted September 18, 2015 I actually started by trying to rotate the object after extruding. When I couldn't get that to work I moved the node to rotate the 2d object first. I couldn't get that to work either. That's when I posted here. Thanks for all of the info. I'll give it another try when I'm back at my computer. KM Quote Link to comment
Kevin McAllister Posted September 20, 2015 Author Share Posted September 20, 2015 (edited) I can't duplicate the crash here, but I do see the rotate problem and am fixing it. It is only a problem when rotating a planar object inside of a Marionette object. If you rotate the extrude instead it should work. Please let me know if anyone else is getting a crash with this file. Sorry for the inconvenience. Hi Mark, There is definitely a bug or two with the Transform2 node. It doesn't seem to respect the anchor point input and always rotates around 0,0. I'm not a programmer but I stripped it right down to the basics for rotation and now its working for what I need. (I really wish VW treated everything like it was 3d. Fighting against the planar stuff is such a challenge when scripting and makes things so much more complex than they need to be.) This is what I ended up using: @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): this = Marionette.Node( 'Transform Modified' ) this.SetDescription( "This node will transform a 2D object or 2D vector") anchor = Marionette.PortIn( (0, 0), 'anchor' ) anchor.SetDescription('A 2D point to rotate about. If not provided object will rotate around it\'s center') rotate = Marionette.PortIn( 0, 'angle' ) rotate.SetDescription('A single rotation angle around Z') input = Marionette.PortIn( vs.Handle(0), 'obj') input.SetDescription('The 2D object to transform') output = Marionette.PortOut('obj') output.SetDescription('The transformed object') def RunNode(self): i = self.Params.input.value r = self.Params.rotate.value a = self.Params.anchor.value vs.HRotate(i, a, r) self.Params.output.value = i There's some sort of issue with the basic Rotate node as well. I gave up on that one. Cheers, Kevin Edited September 20, 2015 by Kevin McAllister Quote Link to comment
Tom Klaber Posted February 17, 2016 Share Posted February 17, 2016 Any update on the tutorial on how the rotation node works? Why can't I just give it a degree value?? Quote Link to comment
Jonathan Pickup Posted February 18, 2016 Share Posted February 18, 2016 i wish we could specify an angle Quote Link to comment
AlanW Posted February 18, 2016 Share Posted February 18, 2016 (edited) Just use the Vec3 node from input section and you can specify the angle of the rotation. You rotate them about one of the x,y,z axis and input the angle you need. The rotate node asks for an angle about a vector. rVec.SetDescription('It could be a 2D/3D rotation vector or Point2/Point3 in the Input category. Angles are in degrees') see file The Transform2 Node works ok in a PC. This one askes for a specific angle around the Z axis. rotate.SetDescription('A single rotation angle around Z') HTH. Edited February 18, 2016 by Alan Woodwell Quote Link to comment
the frog Posted February 18, 2016 Share Posted February 18, 2016 Be sure your script is not the only one that crashes VW, Personally I record every 5 to 10 actions switching from name V1 to name V2 and keep the VW backup file as well. This way I don’t have to rewrite my title name every 1mn (this is the frequency of crash if the script is wrong somewhere). About the crash it depends of the mac system version I don't crash the same way in 10.10 and 10.10.5 Quote Link to comment
Tom Klaber Posted February 18, 2016 Share Posted February 18, 2016 Thanks. What I wanted to try and do was to randomly rotate a set of objest and stack them. So I needed to created a way to get a list of random outputs to then convert to a Y axis rotation . I was able to use the transform node to accomplish this. Is there a way to convert a number to a V3 input? Quote Link to comment
Kevin McAllister Posted February 18, 2016 Author Share Posted February 18, 2016 (edited) Why can't I just give it a degree value?? i wish we could specify an angle You can. I'm not sure if its documented. Use a Point3 node as input into the Ang port and put the angle in the Z value. The only weirdness is the Z field shows up as a dimension instead of degrees depending on your file units setting. I've attached an example file. Kevin Edited February 18, 2016 by Kevin McAllister Quote Link to comment
Vectorworks, Inc Employee SBarrettWalker Posted February 18, 2016 Vectorworks, Inc Employee Share Posted February 18, 2016 Hello all, It is frustrating that a number value can't be used as the input of a rotate node, but that is because the rotate node allows you to rotate objects not only two-dimensionally, but also around the x and y axis. Thus you have to specify the axis that you are rotating around with a point3 or vector3 node. In order to create a series of rotation values, use a Point3D node from the Points category and put the angle values into the z input of the Point3D node. (A point3 or vector3 node does not allow inputs from other nodes, only typed in inputs.) Remember though that you need the same amount of objects as rotation values, otherwise it will add the rotation values together. Quote Link to comment
AlanW Posted February 18, 2016 Share Posted February 18, 2016 (edited) Look at this network published by Luis M Ruiz earlier in the forum. Duplicate & Scale and with a little bit of work you could convert it into making a 3D object and then adding the move in the Z direction. All the Examples are found here and they are Magic and worthwhile and they give fantastic and simple process (Workflow) examples. A must for anyone starting out or needing a great reference library. https://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=217457#Post217457 HTH Edited February 18, 2016 by Alan Woodwell Quote Link to comment
AlanW Posted February 18, 2016 Share Posted February 18, 2016 (edited) (A point3 or vector3 node does not allow inputs from other nodes, only typed in inputs.) HI, Agree, I normally will control the rotation in the OIP so I name the Vec3 node and it shows up and I can rotate in any of the 3 Vectors. See Endless file attached. If within a network then its simple a matter of using the rotate to get the orientation of a specific item as needed. See Caster-02 file for rotating within network. HTH Edited February 18, 2016 by Alan Woodwell 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.