Hey guys,
I am trying to get a setup working with dynamic material instancing as described in this: http://www.sidefx.com/docs/unreal/_materials.html#MaterialsInstances [www.sidefx.com]
I setup a simple example scene with a grid and box copied onto the points. I want each box to have a different material instance with a different diffuse color. All the points have a “unreal_material_instance” parameter pointing at the same existing unreal base material. Each point has a different color value which I put into both “Cd” (to visualize in houdini) and “unreal_material_parameter_diffuse”. The boxes are packed and copied with a copy to point and the unreal values are moved to prim values on the final output.
I can't seem to get this to work properly in unreal. The first time I did it, it successfully made one instance material in “HoudiniEngine/Temp” that seemed to get the diffuse color from point 0, but it applied to all the boxes. I changed the color on all the boxes to red just to see if it was listening to the color and resaved my hda. Upon reloading it, it seems to have stopped listening all together and just assigns a default material. I deleted the hda and the temp instance material and reimported the hda, but that didn't change the behavior.
Is it supposed to work in the scenario I am showing? I am a little fuzzy on what logic might be happening with the prim attributes coming from the copy as the boxes are packed (packed so unreal sees them as instances). I tried a variation on this with the object level instancing node, but that had the same outcome and I wasn't sure if my unreal attrs were even making it on the instances.
Am I doing something wrong? Should my example be working? It would be great if I could get this to work!
I looked at: https://www.sidefx.com/forum/topic/53354/ [www.sidefx.com]
But that scenario is a bit different than mine (multiple materials on one object).
Thanks ahead of time for any help.
ps. I played with that new unreal_split_instances option. It's great and I know that gets the desired result, but splitting the instances on the scale I am working with causes a large perf hit. I basically I want the functionality the “unreal_material” parameter gives you with the added bonus of creating the instance materials automatically based on parameter changes the way the documentation describes “unreal_material_instance” and “unreal_material_parameter_xxxx” functioning.
Houdini Indie 16.5.496 and Unreal Engine 4.19.2