Jump to content

Removing shopnet attribute in bulk?


Recommended Posts

I'm trying to import an fbx model with embedded textures but the textures don't show up in the render. 

They get hidden in render because of this shop material attribute that I have to delete for each and every piece of the watch.
nEnjQ3L.png

 

Is there an automated way to delete this attribute instead of entering the node for every piece inside the wristwatch?

mOKLwE1.png

I converted the embedded materials by using ODtools.

Here's the project file. 
https://www.dropbox.com/scl/fi/e8803p5cmz2pw3vsct820/wristwatch-material-challenge.zip?rlkey=kys5oyueemjzkv9k7d86vrb9j&st=4wpwuhkt&dl=0

Edited by archz2
Link to comment
Share on other sites

1. Create an attribdelete with required parameters

2. Windows > Python Source Editor

selected_nodes = hou.selectedNodes()
source_node = selected_nodes[0]

subnet_path = "/obj/Hublot_King_Power_F1___Watch_fbx"
subnet = hou.node(subnet_path)
file_nodes = [n for n in subnet.allSubChildren() if n.type().name() == "file"]

for file_node in file_nodes:
    parent = file_node.parent()
    copied_node = source_node.copyTo(parent)

    outputs = file_node.outputs()
    copied_node.setInput(0, file_node)

3. Select attribdelete to copy to

4. Appy script

It will copy-paste selected node into each node in Hublot_King_Power_F1___Watch_fbx subnetwork and attach it to file* node

wristwatch_material_challenge.thumb.jpg.94c494171eb5464aeca437f700248376.jpg

 

Edited by fencer
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...