Jump to content
Developer Wiki and Function Reference Links ×

v2020 Group node does not work as v2019 Group node


Recommended Posts

I've noticed the Group node not functioning correctly lately as well and just assumed it had do to the usual marionette quirks and found other work-arounds. This post prompted me to open up the script and take  a look. The node was updated in April and added 2 lines to the script to perform a conditional check before running the existing group script. Unfortunately my python is very limited and I'm not entirely sure what this code is meant to accomplish. The April 2020 Node will only function correctly when an existing group handle is provided. So it appears that the If statement is checking that the variable 'original' is a group Handle, and if so will run the rest of the script. With no group provided, 'original' returns 0, therefore isn't recognized as a handle and the code in the If portion does not execute and does no grouping. I think there should be an Else statement here with some slightly different code to create a new group when the If portion fails, but I don't follow why this would be necessary when the 2019 code worked fine without the change. 

 

Basically, this appears to just be a bug that should be reported as best I can tell. Maybe somebody with better python/vectorscript knowledge can shine some light on this and explain things if I'm wrong.

 

375920378_Annotation2020-08-28111350.thumb.jpg.08125e9cf21408f2900fb82b93fc1ef4.jpg

Edited by AlHanson
Link to comment

Hello

I have tried to understand the differences between the scripts.

In the node “group” at the end    

 

 

 

 

1098747222_Capturedecran2020-08-28a22_43_39.thumb.png.353e39502e27be1d8a504c6f72c2eb24.png

 

 

 the only one is the beginning: #COMMAND;READONLYREFFILE;[VWLibDef]/Operations\Group.py;

#Modified April 2017

 

 

 

If you take this out of the script the node works perfectly fine. Don’t ask me why ??? And you get the same result as in 2019

What is weird is that this text is only a reference about the node and shouldn’t interfere in the node process.

Link to comment

I tried removing the first lines as you suggested and it doesn't make any difference for me- the new node doesn't function without plugging in an existing group handle. Removing those lines *shouldn't* affect anything- they're both comments that are unrelated to the execution of the script as you say. The first #COMMAND... is only to flag the script as read only. The only thing removing it should accomplish is allowing you to save any changes made. So if that's making the node function on your end that is quite bizarre... but seems to be par for the course for my experience with Marionette so far.

Link to comment

Now we have another subject!

I edited both nodes from the script and beside the “locker” they are alike. You have another group node with more lines.

If you start from the original file and run the network the 19 is working and not the 20.

By deleting the first 2 lines in the 20 the network works on my version of 2020 SP3/ build 537701 French version.  Marionette mystery…

A copy of the scripts bellow

Capture d’écran 2020.png

Capture d’écran 2019.png

Link to comment
13 hours ago, AlHanson said:

Basically, this appears to just be a bug that should be reported as best I can tell. Maybe somebody with better python/vectorscript knowledge can shine some light on this and explain things if I'm wrong.

 

I think the same. This really looks like a bug or some kind of "work in progress" thing that was not finished. I will report it and maybe it will be changed in the next patch. It is a quite important node so it should be fixed as soon as possible.

 

@AlHanson, @the frog - thank you so much for your time 🙂

Link to comment
  • 2 months later...

This is my code for a New Group node, which resolved the problem for me (in conjunction with the Loft Surface node):

 

#REFFILE;REFFILE;[VWLibDef]/Operations\Group.py;
#Author: ?
#Modified on: 2020.11.11 17:00
#Modified by: Konrad Br.

@Marionette.NodeDefinition

class Params(metaclass = Marionette.OrderedClass):
#APPEARANCE
	#Name
	this = Marionette.Node( "New Group" )
	this.SetDescription( 'This node creates a new group.\n' )
	
	#Input Ports
	handle = Marionette.PortInLists( vs.Handle(0), 'hObjs' )
	handle.SetDescription('The objects to add to the group') 
	
	#OIP Controls
	
	#Output Ports
	group = Marionette.PortOut('hGroup')
	group.SetDescription('A new group containing the objects')
	
#BEHAVIOR
	this.SetLinksObjects()

def RunNode(self):
	#inputs
	h = self.Params.handle.value

	#script
	new_group = vs.BeginGroupN()
	for i in h:
		vs.CreateDuplicateObject(i, None)				
	vs.EndGroup()
	for i in h:
		vs.Marionette_DisposeObj(i)
		
	#outputs
	self.Params.group.value = new_group

 

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