[Solved][LOPs][Solaris] Assigning materials to instanced primitives

   4928   2   1
User Avatar
Member
6 posts
Joined: March 2019
Offline
Hi all!

I'm new to Houdini and lately I have been playing with the Solaris context a bit but I can't seem to figure out how to assign materials there to instances of stuff created with "Copy to points" SOP operator. I have no problems with assigning mats to simple objects and subgroups, I just don't know how to handle instanced stuff.

In the attachments you can find what I have been experimenting with.

It's a WIP of a yerba mate gourd with some leaves and stems inside.
They were created using the copy to points SOP operator and then simply imported to LOPs using the "SOP Import" op.
I also imported materials using the "Scene import materials" node.
Then I tried to assign mats to primitives under /yerba/Prototypes in the scene graph.
No dice though.

Can you point me in the right direction?
Any way is appreciated, not scared of long docs or day long videos
Edited by mksondej - Sept. 1, 2021 18:03:59

Attachments:
Screenshot 2021-08-31 193715.jpg (9.3 KB)
mate_gourd.hiplc (1.1 MB)

User Avatar
Staff
1471 posts
Joined: July 2005
Offline
Maybe this thread will help: https://www.sidefx.com/forum/topic/79855/ [www.sidefx.com]
User Avatar
Member
6 posts
Joined: March 2019
Offline
Hi @rafal. Thanks for the response. It did kind of help and I was able to indirectly find a solution.

That thread, while not exactly about my exact scenario, gave me a clue to check the inherited attributes of primvars in the scene graph and after some experiments, I was able to deduce that:

- the way I was assigning materials to /yerba/Prototypes/* indeed had 0 effects on other /yerba/* elements. It seems that those elements are unique copies of prototypes and it's not possible to simply modify the prototype and expect automatic propagation down the "hierarchy"
- I can modify materials of all of the "copies" using "material variation LOP", but it is quite slow in my scenario (10k elements)
- My core issue and final solution: It seems that the "SOP Import" LOP operator handles packed instances sub-optimally by default. The moment I switched "Primitive Definition -> Packed Primitives" option to "Create Point Instancer" not only did my viewport get faster, but it also greatly simplified the scene graph (see attached screenshots). In the new hierarchy the concept of "Prototypes" still seems to exist, but you don't see the 10k Xforms, for each element.
When I used "assign material" LOP on those prototypes it worked as expected just like that. It propagated to all instances of that prototype

TL;DR Solved. I need to read more about packed primitives in Solaris.
Edited by mksondej - Sept. 1, 2021 18:05:49

Attachments:
Screenshot 2021-09-01 234934.jpg (13.2 KB)
Screenshot 2021-09-01 235011.jpg (27.6 KB)
Screenshot 2021-09-01 235606.jpg (17.3 KB)

  • Quick Links