Skip to content

Commit

Permalink
Update externaldragdrop.py
Browse files Browse the repository at this point in the history
Add support of USD (use "USD Import" in SOP and "Reference" in LOP)
  • Loading branch information
LewisOrton committed Apr 1, 2021
1 parent e59425e commit 8186c32
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/externaldragdrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def dropAccept(files):
file_path = file[7:]
else:
file_path = file
#print(file)


file_path = unquote(file_path) #decode urlpath
Expand Down Expand Up @@ -75,6 +76,8 @@ def import_file(network_node, file_path, file_basename, file_ext, cursor_positio
elif file_ext == ".ass":
create_new_node(network_node, file_path, "arnold_asstoc", "ass_file", cursor_position, name = file_name)
return True
elif file_ext in {".usd", ".usda", ".usdc"}:
create_new_node(network_node, file_path, "usdimport", "filepath1", cursor_position, name = file_name)
else:
create_new_node(network_node, file_path, "file", "file", cursor_position, name = file_name)
return True
Expand All @@ -93,6 +96,9 @@ def import_file(network_node, file_path, file_basename, file_ext, cursor_positio
elif network_node.type().name() in {"cop2net", "img"}:
create_new_node(network_node, file_path, "file", "filename1", cursor_position, name = file_name)
return True
elif network_node.type().name() in {"lopnet","stage"}:
create_new_node(network_node, file_path, "reference", "filepath1", cursor_position, name = file_name)
return True
return False

def create_new_node(network_node, file_path, node_name, parm_path_name, cursor_position, **kwargs):
Expand Down

0 comments on commit 8186c32

Please sign in to comment.