Jump to content
Developer Wiki and Function Reference Links ×

Ungroup node not working


AlanW

Recommended Posts

Yes, a Marionette network will generate a Group as the output.  You can manually ungroup it afterwards. I THINK there might be a way to generate the individual geometry.

 

But if you ungroup (or manage to generate individual geometry), then you lose the automatic ability for the Marionette Network to automatically delete the old geometry when you make a change.

 

So in your example in you named your Point nodes so they show as parameters in the OIP, you could change them and have the original geometry deleted and the new geometry drawn.  Which is the original idea behind Marionette. 

 

I Think.

Link to comment
  • 1 month later...

Has anyone successfully got this to work as an option within a wrapper? I can get it to work unwrapped but it breaks once wrapped.

 

Simple example attached.

 

For background: I have a script that, once configured, is to be run multiple times to build geometry on a set of control lines of the same length. I'd like the users to be able to simply chose to ungroup/detach the geometry from Marionette once they are ready to build on all the lines.

Detach From Script Example.vwx

Link to comment

Hello,

 

it seems like it does not work in your case, because the wrapper builds a group in which all groups from the network are put in. So you have groups that were made by nodes in a group that was made by the wrapper.

 

There are two solutions that come to my mind:

  1. Ungroup every group from every node that created one, aswell as the group from the wrapper, with a node. I think doing the above two or more times might do the trick, although i have not testet that. I also spotted something i dont like in the network from my previous post. I think it would be better to put a "remove duplicates" node between "get parent" and "ungroup" node, so that the network only tries to ungroup every group once.
  2. Set the parent of all created objects to be the active layer (or any other layer you want). Unfortunately i could not find a node that comes with vw that does that. But because i can write nodes by myselfe i quit searching pretty quick and just write the node myself. Just replace the whole code in any node with this code and click on ok. If you find another node that does the same thing as mine, than use the other node. Chances are high, that it is written better than mine.

Here is the code of the node:


@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
#APPEARANCE
	#Name
	this = Marionette.Node( 'set_parent' )
	this.SetDescription( 'set_parent' )

	#Input Ports
	x = Marionette.PortIn( [], 'items' )
	x.SetDescription( "items" )

	#OIP Controls

	#Output Ports
	y = Marionette.PortOut('items')   
	y.SetDescription( "items" )

#BEHAVIOR
	this.SetListAbsorb()
	
def RunNode(self):
	#inputs
	x = self.Params.x.value

	#script
	handle_active_layer = vs.ActLayer()
	
	for item in x:
		vs.SetParent(item, handle_active_layer)

	#outputs
	self.Params.y.value = x

 

Here is an image of your wrapper with the node, and as far as i can tell it works (i'm sorry i cant give you the .vwx file, because i only have an educational version):

grafik.thumb.png.5833a358b0c83426cf1004f0721cd5c3.png

 

 

Regards,

Letti

  • Like 1
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...