Revit Categoty MaterialBindingAPI error -> instancing?

Hello
I want to convert from Revit to USD and then freely change the material using “MaterialBindingAPI” by Revit category or family.
I’m not mapping all materials in Revit and coming over to USD, but I’m in a situation where I want to do various things with scripts on USD.
If the prim path is /World/(Revit filename)/Geometry/Pipe_Fittings/…/…, when I apply MaterialBindingAPI by grouping Pipe_Fitting and traversing the component elements below, the conversion does not work. It seems to be an issue with Instance Proxies.
What methods are needed to easily handle objects that come from Revit with scripts?

Example source code:

group_path : /World/(Revit filename)/Geometry/Pipe_Fittings
material_path : /World/Looks/Aluminum_Sheet_Glossy_Streaks

def apply_material(self, group_path, material_path):
stage = omni.usd.get_context().get_stage()
material = UsdShade.Material(stage.GetPrimAtPath(material_path))
group_prim = stage.GetPrimAtPath(group_path)
for prim in Usd.PrimRange(group_prim):
if UsdGeom.Xform(prim) and not prim.IsA(UsdGeom.Scope):
UsdShade.MaterialBindingAPI(prim).Bind(material)

Very good question. Let me find out and get back to you. I would say you are better off getting your REVIT scene into usd composer first and then using scripting in composer to change your scene. Not the other way around.

When using the Revit connector, I recommend unchecking Instance Families; this will allow material biding to propagate down. also, make sure you set the material strength to be stronger than the decedents

It works normally when I do it as you recommend! Thank you so much!!

Great to hear !!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.