RickR Posted July 25, 2017 Share Posted July 25, 2017 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. Quote Link to comment
RickR Posted July 25, 2017 Author Share Posted July 25, 2017 Minor update: In this test file it seems only the last object created is moved. Linear Arry test.vwx Quote Link to comment
DomC Posted July 25, 2017 Share Posted July 25, 2017 (edited) 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 July 25, 2017 by DomC Quote Link to comment
Pat Stanford Posted July 25, 2017 Share Posted July 25, 2017 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? Quote Link to comment
Patrick Winkler Posted July 26, 2017 Share Posted July 26, 2017 (edited) 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. regards Edited July 26, 2017 by Patrick Winkler Quote Link to comment
RickR Posted July 26, 2017 Author Share Posted July 26, 2017 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. 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.