Newbie question : modify a copy
Something that I assume is possible and hopefully easy, but I can't quite figure it out.
I'd like to make a complex object (multiple sub-nodes) then use Copy to duplicate it, and modify the copy in a simple way (transform location, set color, etc) and ideally modify each instance of the copy. Is there a way to visualize or "expand" each copy so that you can modify it more easily/directly?
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by john on 09 May, 2021 10:54 PM
Hi Jared,
I have attached a demo which I hope will illustrate some basic principles.
I form a complex object by combining a square, a white circle, and a text path (the letter a), and then using a group node to merge them into a single "geometry".
At this point I only have one object. But when I feed it into a translate node along with a list of 12 ransom points, I get 12 different copies of the object, each at a different location. In one step I have copied the object and also modified each copy by giving it a different location.
(I could also have used a repeat node to create multiple identical copies without changing any properties.)
Suppose I now wish to modify my complex objects further by assigning each a different random color. If I feed my list of objects and my list of colors into a colorize node, all components of my complex object (the square, the circle, and the text path) will all be colored at once with the same color - which may not be what I want. (Render the colorize2 node to see what this looks like.)
If I want to color just part of my conplex objects, say just the circles, I will need to create a little subnetwork like my "color_dot".
If you peer inside color_dot you will see that it takes two parameters: the object (pulled in using a null node) and the color for that copy of the object. The subnetwork then ungroups the object, colors just the circle (the second object in this case), recombines them in their original order, and then regroups them.
The result, as you can see in the screenshot, is 12 complex objects, each with a different location and a differently colored circle.
Does that help?
If not, if I am misunderstanding your question, please reply with more details about your complex objects and exactly what you are trying to do to them.
2 Posted by Jared Zimmerman on 10 May, 2021 08:20 PM
Thank you! this is *almost* exactly what I was talking about, the only difference, was can you specifically address and color one instance, e.g. copy 1 red, copy 2 blue, copy 3 green
Support Staff 3 Posted by john on 11 May, 2021 03:36 AM
Jared,
This example is already doing that. The first object is colored red, the second yellow, etc. The colors are in a specific order, as are the objects. The colorize or color_dot nodes will always match them in that order: first to first, second to second, etc.
The trick is keeping track of those orders. The order of your objects can work as an ID system. Your first object is object 0; the second, object 1; the third, object 2; etc.
If you want to make an assignment to just one of your objects, say object 2, you can use a slice node to pull it from the pack. Feed your list of objects into the slice node with start set to your ID number and size set to one; the result will be object 2 which you can then do with as you wish.
(If you want to keep doing this, you will want to put object 2 back in the original order. You can make a subnetwork to this in a generic way by combining slices of everything before, the object, and everything after.)
If you're doing a lot of different manipulations, it might be worth creating a table of objects using the make_table node. You can put your objects into one column of this table, an ID code or title in another column, and various properties or metadata into other columns. You can then sort this table and filter it to extract any object (or subset of objects) you wish. Let me know if you want me to create a demo of this technique.
Thanks for the interesting question, a question I'm sure others have had as well. Keep playing and feel free to send me more questions.
John
4 Posted by Jared Zimmerman on 11 May, 2021 12:11 PM
Great, than you I understand now! appreciate it!