Jump to content
Developer Wiki and Function Reference Links ×

Marionette Method SetLinksObjects()


ahedley

Recommended Posts

  • Marionette Maven

SetLinksObjects() links the output geometry to the Marionette node so that if you were to re-run the network, the geometry previously drawn would get replaced with the newly drawn object(s). This is to prevent duplicate objects and allow easier updating if a user were to change a variable/parameter.

It's good practice to always use SetLinksObjects() when the node produces any sort of geometry.

I can try to explain further if need be.

Link to comment
SetLinksObjects() links the output geometry to the Marionette node so that if you were to re-run the network, the geometry previously drawn would get replaced with the newly drawn object(s). This is to prevent duplicate objects and allow easier updating if a user were to change a variable/parameter.

It's good practice to always use SetLinksObjects() when the node produces any sort of geometry.

I can try to explain further if need be.

@MarissaF: Yes - further explanation would be most helpful, maybe even a short tutorial.

I don't see 'SetLinksObjects()' on the standard Marionette node list (obviously), and a 'Search' on the Dev Wiki for 'SetLinksObjects' yields no results - so I'm not sure how anyone would know that it's good practice.

Is it something that is already coded inside the standard Vw geometry-producing nodes? Is it something that we need to add manually to any Custom geometry-producing nodes?

Thanks.

Link to comment
  • Vectorworks, Inc Employee

I don't see 'SetLinksObjects()' on the standard Marionette node list (obviously), and a 'Search' on the Dev Wiki for 'SetLinksObjects' yields no results - so I'm not sure how anyone would know that it's good practice.

You wouldn't! That's something we are trying to resolve.

With the advent of Marionette, users who would never have touched anything related to Vectorscript before are now diving right in, and with new eyes on it a lot of the weak points in documentation start to stand out. Many of the heavy scripting users here have been working with VS for decades and have developed their own best practices, but its about time we (Vectorworks) started making them more public and clearer.

The resources required for this are beyond my means to make many promises on, but I am pushing hard for an increase in this sort of documentation. The more the better.

Link to comment
  • Marionette Maven

@rDesign:

Currently, to my knowledge, all default content nodes that produce geometry have SetLinkObjects() specified.

If someone were to create their own custom geometry node, it is not *required*, but it's definitely recommended, because linking the geometry to the node that produces it will prevent duplicating the output geometry every time you run the network, and will also respectively update the output geometry each time you run the network.

Think of it this way - by using the SetLinkObjects(), each time you run a marionette network, all of the output geometry is erased/deleted, and everything is completely redrawn. Without the linking of the objects to the node, a part of the created object could be left behind.

I'll work on putting together a file that shows the difference when the SetLinkObjects() is used versus when it is not. I will also try to put together some useful knowledge for creating custom nodes, since it's apparent that there are some things missing from the public knowledge, and even my own still, from time to time.

Link to comment

Thanks MarissaF, that explains it better.

I thought I had noticed in playing around with some of the sample Marionette networks downloaded from the forum's Resource Sharing section that I did have to delete the output geometry before changing variables, otherwise you'd get multiple instances of the output geometry, exactly as you describe.

Any explanations and best practices for creating custom Marionette nodes would be most welcome. Thanks.

Link to comment

Thanks MarissaF, I somewhat suspected it had to do with object creation.

I know marionette was introduced with the notion that non programmers could get involved without programming. Maybe its the newness or the "star trek" feeling of going where no man has gone before but I need to ask - Are there other similar methods which can add functionality to marionette that you can briefly divulge?

Link to comment
  • Marionette Maven

I'll have to skim through my current resources and notes and see what I can put together.

I often come across things that I didn't already know and have to track down someone to help me learn what exactly certain lines of code will do, and unfortunately my desk is just covered in sticky notes about Marionette as a whole... I really should sort them out sometime.

But I definitely plan to compile a list of helpful information that isn't very intuitive to non-programmers!

Luckily, since I now help with developing new content, I should be able to help you and other users as I learn more on my own. :)

If you haven't looked at the Marionette Basics or Marionette - Implement a Node, these would be a great place to start while I poke around. There is a lot of information on the second link that will help to show some obscure tricks for custom nodes, although it's not extensive.

Link to comment
  • 4 years later...

Hello @Marissa Farrell


I would like to take up the question above again. Is there a list of commands somewhere that you have added to the default nodes under #Behavior?

Preferably also with effects on the node.

 

I mean code lines, like these:

this.SetLinksObjects()
this.SetListAbsorb()

 

Edited by MRoth
Link to comment
  • 1 year later...

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...