mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Refactor to lib
This commit is contained in:
parent
5a280a32bb
commit
22ddb58cca
1 changed files with 14 additions and 0 deletions
|
|
@ -3446,3 +3446,17 @@ def iter_visible_nodes_in_range(nodes, start, end):
|
|||
def get_attribute_input(attr):
|
||||
connections = cmds.listConnections(attr, plugs=True, destination=False)
|
||||
return connections[0] if connections else None
|
||||
|
||||
|
||||
def write_xgen_file(data, filepath):
|
||||
lines = []
|
||||
with open(filepath, "r") as f:
|
||||
for line in [line.rstrip() for line in f]:
|
||||
for key, value in data.items():
|
||||
if line.startswith("\t{}".format(key)):
|
||||
line = "\t{}\t\t{}".format(key, value)
|
||||
|
||||
lines.append(line)
|
||||
|
||||
with open(filepath, "w") as f:
|
||||
f.write("\n".join(lines))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue