Jump to content
zhyravetsky

packed primitives material assignment

Recommended Posts

i have an obj with groups for materials... how should i assign material for each group after pack primitives...help ?

Share this post


Link to post
Share on other sites

Packed Edit SOP/Materials tab

Edited by anim

Share this post


Link to post
Share on other sites

It's possible to add the "Declare Materials" parameter to the output driver, which can force all SHOPs to be sent down to mantra. Or if you're technically savvy, it's possible to write an IFD render hook to ensure the right data is there. 

Share this post


Link to post
Share on other sites

Did you get this fully working? I only get two materials instead of four with your example.

 

Can't really find any other examples on how to do this either.

Share this post


Link to post
Share on other sites

I agree, I only get two materials showing up in the viewport in your example.

I am not quite sure how the "pick" field is working either. There seems to be nothing entered in there for any of the four assignments in the packed edit SOP but somehow the materials are applied to the top and bottom groups.

When I try and click "pick" I don't get many options of what to pick...

 

Any thoughts?

Share this post


Link to post
Share on other sites

They really should have included some example hip on how to use Packed Edit.

Share this post


Link to post
Share on other sites

partially found in another thread : http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=30134&sid=5bc3852085c989c506218238701b0866

 

Create a primitive name attribute with `substr(prims("../"+opinput(".",0),$PR ,"shop_materialpath"),rindex(prims("../"+opinput(".",0),$PR ,"shop_materialpath"),'/')+1,50)`

you need to have assigned materials first. Then pack your geo with the name attribute checked.

Once you've copied it all you can pick the packed name on the packededit sop and re assign the material.

For me at least this is actually much slower than splitting each object based on material and creating a copy sop with "pack geometry before copying" checked and then merging it all back after assigning the material to the output.

I get much less memory usage this way and the viewport is much more responsive (with around 45 million packed polys).  I have submitted this as a bug and hopefully it'll be 'fixed' as I'm not sure if it's actually a bug.

 

Hope this helps.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks, will try both approaches when hopefully back at work tomorrow.

Share this post


Link to post
Share on other sites

What I thought was a bug was just me misunderstanding packed fragments/geometry.  Hopefully this should be useful for more people than just me:

The Pack SOP in tomorrow's build of Houdini (13.0.321) will have an option to specify if Packed Fragment or Packed Geometry primitives should be created when packing by name.

Share this post


Link to post
Share on other sites

Mantra ROP -> Rendering -> Render: Declare Materials: Save All Materials and Shaders

  • Like 1

Share this post


Link to post
Share on other sites

That's works, danke!

Should I always use this option when using packed primitives? Why Mantra lose those materials in IFD if they are in the scene?

Share this post


Link to post
Share on other sites
12 minutes ago, kiryha said:

That's works, danke!

Should I always use this option when using packed primitives? Why Mantra lose those materials in IFD if they are in the scene?

Yes you always have to use that option when using packed primitives. I'm not a 100% sure but I think for performance and efficiency reasons Houdini only saves those materials into the IFD where it knows (at time of IFD creation) that they are being used. Now if you pack away the geometry, Houdini doesn't see the material as used anymore (because it's only storing some reference to the packed geo).
 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×