Question about Map by Expression

   1406   3   1
User Avatar
Member
2 posts
Joined: 11月 2017
Offline
Hello,
I'm trying to setup a TOP network but I'm not sure how to proceed.
I have “old_sim”, which is a sequence of 50 work items, and “geo”, which is a single work item. Then I want to cache “new_sim”, which is another sequence of 50 items, and I need each of its frames to be dependent on both the corresponding frame of “old_sim” and “geo”.
Since I was able to set a dependency between “old_sim” and “new_sim” with a Map by Index, my first thought was to use a Map by Expression but I can't seem to find an expression that could work.
Is this the right approach?

Thank you.

Attachments:
tops.PNG (80.8 KB)

User Avatar
スタッフ
585 posts
Joined: 5月 2014
Offline
The best way to achieve what you want is to use a Partition by Index node. I've attach an example scene file that has a simple set up with generic generators like you did in your screenshots, as well as a more concrete example with ROP Geometry nodes.

Attachments:
partition_example.hip (123.2 KB)

User Avatar
Member
2 posts
Joined: 11月 2017
Offline
Thank you tpetrick that works perfectly. I have a question about your setup though.
Sim2 is set to generate one item and depends on the previous nodes to generate the correct number. Is there a reason to set it to one even though it's a simulation? Why not set it to 50 like the others and put a Map by Index in between?
User Avatar
スタッフ
585 posts
Joined: 5月 2014
Offline
If you set it to 50 frames and use a mapper, the second simulation will have a hardcoded number of frames. It won't work with wedging, or if the upstream frame range is variable, or loaded from a file or something else in the scene. Attributes are not copied across mappers – each node above and below the mapper must be able to generate work items independently.

For example, with the setup I sent you can wire a wedge node into the first simulation, and the second simulation will also be wedged. PDG will correctly create 4 simulations in the second sim node, based on the work items in the partition by index.

Attachments:
wedging.png (56.4 KB)

  • Quick Links