Hans Martin Kern Posted September 12, 2017 Share Posted September 12, 2017 All, I'm trying to get my feet wet with creating Marionette nodes to support @Stephan Moenninghoff's endeavours. As you would expect from an old fart I run into all kinds of problems, so please feel free to hit me with a rolled-up newspaper if my questions are way too basic. My first "project" is a node creating any kind of custom object (code below). I tried both interiorcad's objects and stock VW plug-in objects. Works beautiful. If I route the custom object created by my node through the stock "Set 3D Rotation" Marionette node, the object is not rotated. I'm sure I'm missing something obvious here - any hints? Thanks! HMK == @Marionette.NodeDefinition class Params(metaclass = Marionette.OrderedClass): #APPEARANCE #Name this = Marionette.Node( "Create Custom Object" ) this.SetDescription('Creates a custom object') #Input Ports universalName = Marionette.PortIn(0) universalName.SetDescription('The universal name of the custom object') position = Marionette.PortIn(0) position.SetDescription('Insertion point of object instance') rotation = Marionette.PortIn(0) rotation.SetDescription('Rotation angle of object instance') showPropertiesDialog = Marionette.PortIn(0) showPropertiesDialog.SetDescription('Show the object''s properties dialog') #OIP Controls #Output Ports object = Marionette.PortOut('hObj') object.SetDescription('The resulting object instance') #BEHAVIOR def RunNode(self): #inputs universalName = self.Params.universalName.value position = self.Params.position.value rotation = self.Params.rotation.value showPropertiesDialog = self.Params.showPropertiesDialog.value #script customObject = vs.CreateCustomObjectN(universalName, position[0], position[1], rotation, showPropertiesDialog) #outputs self.Params.object.value = customObject Quote Link to comment
Patrick Winkler Posted September 13, 2017 Share Posted September 13, 2017 Hi Hans, could you provide a vwx file to reproduce the problem. Quote Link to comment
Hans Martin Kern Posted September 13, 2017 Author Share Posted September 13, 2017 (edited) Patrick - sure, here it is. Just for fun, I try to create & rotate a "Screw and Nut" custom object. RotatingScrew.vwx Edited September 13, 2017 by Hans Martin Kern Quote Link to comment
Patrick Winkler Posted September 13, 2017 Share Posted September 13, 2017 Run it in 3D view and it will rotate. Quote Link to comment
Hans Martin Kern Posted September 13, 2017 Author Share Posted September 13, 2017 Patrick, thanks for the hint. However, this leads to the inevitable question: How do rotate a custom-object without taking the current view into account? Coming from an SDK background, I would expect to set the custom object's 4x3 TransformMatrix and I'm done. HMK Quote Link to comment
Patrick Winkler Posted September 13, 2017 Share Posted September 13, 2017 (edited) Hans, you just mentioned the solution. I forgot that there is a transfrommatrix-node. The Rotate3D node could be fixed by checking the type for PlugIn objects and using TransfMatrix in case. (@Marissa Farrel :)) Edited September 13, 2017 by Patrick Winkler 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.