Jump to content
Developer Wiki and Function Reference Links ×

Moving a linear array


RickR

Recommended Posts

I'm back to my traveler curtain object.

My current issue is a symbol that is arrayed. When I apply a move command to the resulting group, the source symbol moves, but all it's copies don't. There seems to be something wrong with the 'Linear Array' node, I think came from @DomC  What would folks suggest for an alternate method?

 

More in the "why did it do that" category: There are 2 Soft Goods objects that get made into groups, that I can't seem to ungroup.

Link to comment

Hi Rick

There is nothing wrong with the "Linear Array xyz"- Node. It moves the object you input and returns them as single objects (The group is made from Marionette after all object creation). If you connect a "Move"-Node, it will move every object by your move Vector.

 

The "Linear Array xyz" - Node, will do the  job. 

 

 

Node:

The Move-Node is not error free. If you have a screen planed symbol it will not move. If you have this, just use this "corrected" Move-Node

Move corrected.vwx

 

Anyway: It would be better (faster) to just move your first object on the right place, and then array it. If you move them after array you move them a second time.

 

 

Edited by DomC
Link to comment

But Rick is not using the Linear Array xyz node, but instead the Linear Array node. 

 

When you wire that to a Move node, it does not move each object, but only the last object in the array.

 

My Python is not very good, but it looks to me like the data coming back out of the node in the self.Params.array.value = objs line is being over written with each iteration through the loop meaning there is only a single value moving on the the Move node.

 

I am probably wrong, but if not, can you explain how that line works to provide the proper array return?

 

 

 

Link to comment

You got it pat ;)

 

I could solve it by replacing the += with .append:

 

def RunNode(self):

	dir = self.Params.dir.value
	obj = self.Params.obj.value
	
	a = 0
	b = self.Params.step.value
	c = self.Params.count.value	
	list = []
	if c != 0:		
		list = [a+n*b for n in range(c)]
	objs = []
	for i in range(len(list)):
		if dir == 0:
			objs.append (vs.HDuplicate(obj, list[i], 0)) # Changed += to append
		elif dir == 1:
			objs.append (vs.HDuplicate(obj, 0, list[i])) #  Changed += to append
		self.Params.array.value = objs

 

The node creates 5 duplicates so you get 6 object s in total at the end. The original was not passed out the Linear Array node.

I appended a Delete-node to the Line-node, maybe you want to at it rather to the output list of linear array.

 

597845bdebbf8_Bildschirmfoto2017-07-26um09_29_58.png.f588489eca6dee84ab50c2329ce0c9f7.png

 

regards

 

Edited by Patrick Winkler
Link to comment

I'll leave the Python wrestling to you guys.

 

"Linear Array XYZ" is doing the job. In my network I was moving many things at once, so it is more efficient programming and I suspect faster in the long run.

 

Thanks Pat for reminding me to delete the original object. I think that caused some issues earlier, but never again. (maybe)

 

I think I've found another odd ball, but I'll post fresh.

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