Guys,
As a new user I've been having a real problem applying materials to FBX imports.
I then realised there was a 'shop_materialpath' attribute ('Level 1' being the value) on the fbx import.
How can I clear this globally - at the OBJECT level? AFAIK I can only connect nodes such as 'atribute delete,' or 'clean geo' node at the GEO level?
Or alternatively how can I do it en-mass with the 400+ nodes in my subnet?
Or is there a better way to approach this?
Cleaning attributes on FBX import.
2299 6 0- Mike_A
- Member
- 179 posts
- Joined: Aug. 2018
- Offline
- jsmack
- Member
- 7759 posts
- Joined: Sept. 2011
- Offline
- Mike_A
- Member
- 179 posts
- Joined: Aug. 2018
- Offline
- tamte
- Member
- 8539 posts
- Joined: July 2007
- Offline
select your FBX object subnet(s) that contains the imported fbx objects and paste this into python shell or create shelf button out of this
nodes = hou.selectedNodes() for fbx_subnet in nodes: if fbx_subnet.type().nameWithCategory() != "Object/subnet": print("Skipping {}, not a valid Object subnet".format(fbx_subnet.path())) continue for node in fbx_subnet.children(): if node.type().name() == "geo": render_node = node.renderNode() mat_attrib = render_node.geometry().findPrimAttrib("shop_materialpath") if mat_attrib: ad = render_node.createOutputNode("attribdelete") ad.parm("primdel").set("shop_materialpath") ad.moveToGoodPosition() if node.renderNode() == node.displayNode(): ad.setDisplayFlag(1) ad.setRenderFlag(1)
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- jsmack
- Member
- 7759 posts
- Joined: Sept. 2011
- Offline
- Mike_A
- Member
- 179 posts
- Joined: Aug. 2018
- Offline
tamte
select your FBX object subnet(s) that contains the imported fbx objects and paste this into python shell
Tomas,
Many thanks for this, I very much appreciate your time, generosity and expertise. It solves the problem.
Having done some further investigation my suspicion is that the issue lies with the fbx file itself. Having done an 'import-re-export' with another application, the problem doesn't seem to occur. With the original fbx, despite being imported 'geometry only' - no materials, it seems it was triggering H to generate a shop_materialpath attribute for no obvious reason.
Your script will be very helpful if we come across this issue again.
With thanks,
Mike A.
Edited by Mike_A - Aug. 6, 2022 10:51:15
- Mike_A
- Member
- 179 posts
- Joined: Aug. 2018
- Offline
-
- Quick Links