NeonClear Posted May 10, 2016 Share Posted May 10, 2016 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? Quote Link to comment
Marionette Maven Marissa Farrell Posted May 10, 2016 Marionette Maven Share Posted May 10, 2016 I think there are issues with the Set Layer node... (Okay, I know there are... and I have NO IDEA where Ham is coming from.) Give me a bit and I'll give you a working example on how to change an object's layer. Quote Link to comment
Marionette Maven Marissa Farrell Posted May 10, 2016 Marionette Maven Share Posted May 10, 2016 Before I do that, do me a favor. Double click on the "Set Layer" node and enter the Script Editor window. Without changing anything, exit out of that, deselect the Set Layer node, and select it again. Does that update the list of popups? Just trying to troubleshoot. Quote Link to comment
Marionette Maven Marissa Farrell Posted May 10, 2016 Marionette Maven Share Posted May 10, 2016 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. Quote Link to comment
NeonClear Posted May 10, 2016 Author Share Posted May 10, 2016 I tried that and no change to the list of popups. I went one further and added #test as the last line of the node and saved it to see if that would refresh it, no luck. Quote Link to comment
Marionette Maven Marissa Farrell Posted May 10, 2016 Marionette Maven Share Posted May 10, 2016 Thanks Brendan, What if you add your "#test" line to the last part of the "class Params()" script, before RunNode()? Quote Link to comment
NeonClear Posted May 10, 2016 Author Share Posted May 10, 2016 That worked! So the band-aid fix is to add and remove that line each time I need to populate this list? I think I can make that work. Quote Link to comment
Marionette Maven Marissa Farrell Posted May 10, 2016 Marionette Maven Share Posted May 10, 2016 For now, that's probably your best bet, aside from using the node in the file I posted earlier in this thread Glad it worked. I'll work with the people who work on the back end to see if we can get this to behave better. Quote Link to comment
Vectorworks, Inc Employee SBarrettWalker Posted May 10, 2016 Vectorworks, Inc Employee Share Posted May 10, 2016 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. Quote Link to comment
Patrick Winkler Posted July 13, 2016 Share Posted July 13, 2016 (edited) 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 July 13, 2016 by Patrick Winkler Quote Link to comment
Marionette Maven Marissa Farrell Posted July 13, 2016 Marionette Maven Share Posted July 13, 2016 Was already on my list! Thanks! 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.