Jump to content
Developer Wiki and Function Reference Links ×

Rotating custom objects?


Recommended Posts

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

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...