Jump to content
Developer Wiki and Function Reference Links ×

Set Layer Node


Recommended Posts

I'm having trouble with the "Set Layer" node, it never populates its list of the design layers in my document. I've attached a picture of my small example where my design layers are "Original" and "Transferred Here" but in the properties for the node my options are "Design Layer-1" and "Ham".

  • Does anyone have insight on how this node is supposed to function?
  • Also does anyone know how I can send an object to another design layer with marionette?

Link to comment
  • Marionette Maven

Here's a file with a node that you can use as an alternative. The downside is that you will have to type in the name of the layer that you want to move your object to in the String node.

This will be the most reliable method for the time being. I know why the current version doesn't work, but I'm not sure how we'll be able to dynamically update the layers that show - the only way right now would be to edit the script in that node, as I've stated in my previous post.

Link to comment
  • Vectorworks, Inc Employee

Hello Brendan - There is a way to make the Set Layer node work. First you must RUN it on its own, then double click to open the script window, close window, deselect, and select again.

The logic behind this is that the node doesn't recognize the layers in the document until it is run, and then it can't transfer them to the drop down menu until the script editor has been opened. If you add layers to your document after you add this node, just run it again and open and close the script window.

Link to comment
  • 2 months later...

Hi Marissa,

This node is kind of danger since it creates a duplicate of the obj and deletes the original.

Here is an alternative:

@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
this = Marionette.Node( "Set Layer" )
this.SetDescription( 'Adds an object to a specified layer' )
object = Marionette.PortIn(vs.Handle(0), 'obj')
object.SetDescription( "The input object" )

layer_name = Marionette.PortIn( None )
layer_name.SetDescription( "Name of the layer." )

obj = Marionette.PortOut()
obj.SetDescription( "The result object" )


def RunNode(self):
obj = self.Params.object.value
layer_name = self.Params.layer_name.value


# Creates the layer if it not alreay exists
vs.Layer (layer_name)

# Get the handle to the layer
lay_h = vs.GetLayerByName (layer_name)

vs.SetParent (obj, lay_h)	

self.Params.obj.value = obj

Edited by Patrick Winkler
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...