fix handles on N type nodes

This commit is contained in:
Sam Lavigne
2023-09-03 16:21:45 -04:00
parent c091ff72ba
commit 43107c6244
4 changed files with 2964 additions and 54 deletions

View File

@ -58,13 +58,22 @@ def get_params(f):
text=True,
capture_output=True,
)
text = help_text.stdout
input_channels, output_channels = f["type"].split("->")
f["inputs"] = list(input_channels.lower().strip())
f["outputs"] = list(output_channels.lower().strip())
try:
text = text.split("AVOptions:")[1]
except Exception as e:
return f
lines = text.split("\n")
params = []
for l in lines:
if not l.startswith(" "):
continue
@ -124,6 +133,12 @@ def get_params(f):
if type(item["default"]) == str:
item["default"] = item["default"].replace("'", "").replace('"', "")
if item["name"] == "inputs" and item["default"]:
f["inputs"] = [f["outputs"][0]] * item["default"]
if item["name"] == "outputs" and item["default"]:
f["outputs"] = [f["inputs"][0]] * item["default"]
else:
item = {"value": parts[0], "desc": " ".join(parts[3:])}
if "options" not in params[-1]: