Newbie question : modify a copy

Jared Zimmerman's Avatar

Jared Zimmerman

09 May, 2021 05:42 PM

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?

  1. Support Staff 1 Posted by john on 09 May, 2021 10:54 PM

    john's Avatar

    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. 2 Posted by Jared Zimmerman on 10 May, 2021 08:20 PM

    Jared Zimmerman's Avatar

    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

  3. Support Staff 3 Posted by john on 11 May, 2021 03:36 AM

    john's Avatar

    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. 4 Posted by Jared Zimmerman on 11 May, 2021 12:11 PM

    Jared Zimmerman's Avatar

    Great, than you I understand now! appreciate it!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

Recent Discussions

23 Jun, 2021 01:36 AM
20 Jun, 2021 07:19 AM
13 Jun, 2021 11:19 PM
06 Jun, 2021 09:27 AM
05 Jun, 2021 10:17 AM

 

05 Jun, 2021 07:45 AM
23 May, 2021 10:05 PM
23 May, 2021 10:02 PM
17 May, 2021 12:04 AM
16 May, 2021 01:00 PM
14 May, 2021 03:16 PM