zhyravetsky Posted January 11, 2014 Share Posted January 11, 2014 i have an obj with groups for materials... how should i assign material for each group after pack primitives...help ? Quote Link to comment Share on other sites More sharing options...
anim Posted January 11, 2014 Share Posted January 11, 2014 (edited) Packed Edit SOP/Materials tab Edited January 11, 2014 by anim Quote Link to comment Share on other sites More sharing options...
zhyravetsky Posted January 11, 2014 Author Share Posted January 11, 2014 (edited) but how to choose existing group..from obj? Edited January 11, 2014 by zhyravetsky Quote Link to comment Share on other sites More sharing options...
zhyravetsky Posted January 11, 2014 Author Share Posted January 11, 2014 http://www.sendspace.com/file/8ge6e2 example Quote Link to comment Share on other sites More sharing options...
zhyravetsky Posted January 11, 2014 Author Share Posted January 11, 2014 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. Quote Link to comment Share on other sites More sharing options...
Erik_JE Posted February 6, 2014 Share Posted February 6, 2014 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. Quote Link to comment Share on other sites More sharing options...
TomRaynor Posted February 7, 2014 Share Posted February 7, 2014 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? Quote Link to comment Share on other sites More sharing options...
Erik_JE Posted February 7, 2014 Share Posted February 7, 2014 They really should have included some example hip on how to use Packed Edit. Quote Link to comment Share on other sites More sharing options...
Mumble Posted February 7, 2014 Share Posted February 7, 2014 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. 1 Quote Link to comment Share on other sites More sharing options...
Erik_JE Posted February 10, 2014 Share Posted February 10, 2014 Thanks, will try both approaches when hopefully back at work tomorrow. Quote Link to comment Share on other sites More sharing options...
Mumble Posted February 12, 2014 Share Posted February 12, 2014 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. Quote Link to comment Share on other sites More sharing options...
kiryha Posted November 8, 2018 Share Posted November 8, 2018 I lose my material assignment when Copy Object to points with "Pack and Instance" enabled. How to fix this? CTP_materials_001.hipnc Quote Link to comment Share on other sites More sharing options...
3dome Posted November 8, 2018 Share Posted November 8, 2018 Mantra ROP -> Rendering -> Render: Declare Materials: Save All Materials and Shaders 1 1 Quote Link to comment Share on other sites More sharing options...
kiryha Posted November 8, 2018 Share Posted November 8, 2018 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? Quote Link to comment Share on other sites More sharing options...
3dome Posted November 8, 2018 Share Posted November 8, 2018 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). 1 Quote Link to comment Share on other sites More sharing options...
mwillustrations Posted April 12, 2021 Share Posted April 12, 2021 On 11/8/2018 at 8:23 AM, 3dome said: Mantra ROP -> Rendering -> Render: Declare Materials: Save All Materials and Shaders I love when the solution is so simple. Thanks for sharing! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.