Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UPDATE] Added parameter restoration to *Gaea TOR Processor SOP 4.0* … #54

Open
wants to merge 1 commit into
base: Development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,38 @@ def RunGaea(a_node, cmd, gaea_dir):

# Resets entire interface with Gaea Parms
def ResetInterface(a_node):
ParmGroup = a_node.parmTemplateGroup()

if a_node.parm("generated_gaeaparms") is not None:
for spareparm in ParmGroup.find("generated_gaeaparms").parmTemplates():
ParmGroup.remove(spareparm.name())
ParmGroup.remove("generated_gaeaparms")
a_node.setParmTemplateGroup(ParmGroup)
ParamGroup = a_node.parmTemplateGroup()
GeneratedGroupName = 'generated_gaeaparms'

# store existing values
CurrentValues = dict()
if a_node.parm(GeneratedGroupName) is not None:
# these will be folders
for folderparm in ParamGroup.find(GeneratedGroupName).parmTemplates():
FolderValues = dict()
for spareparm in folderparm.parmTemplates():
FolderValues[spareparm.name()] = a_node.parm(spareparm.name()).eval()
CurrentValues[folderparm.name()] = FolderValues

if a_node.parm(GeneratedGroupName) is not None:
for spareparm in ParamGroup.find(GeneratedGroupName).parmTemplates():
ParamGroup.remove(spareparm.name())
ParamGroup.remove("generated_gaeaparms")
a_node.setParmTemplateGroup(ParamGroup)

LoadXML(a_node)
ParamGroup = a_node.parmTemplateGroup()

# restore matching values
if a_node.parm(GeneratedGroupName) is not None:
# these will be folders
for folderparm in ParamGroup.find(GeneratedGroupName).parmTemplates():
if folderparm.name() in CurrentValues:
FolderValues = CurrentValues[folderparm.name()]
for spareparm in folderparm.parmTemplates():
if spareparm.name() in FolderValues:
CurrentValue = FolderValues[spareparm.name()]
a_node.parm(spareparm.name()).set(CurrentValue)



Expand Down