Skip to content

Commit 4a9ad97

Browse files
solved cook loop dependency issue for QuickExt
1 parent 72174c3 commit 4a9ad97

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed
Binary file not shown.
Binary file not shown.

scripts/QuickExt/templates/ExtUtils/CustomParHelper/CustomParHelper.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def onParGroup<GroupName>(self, _parGroup, _val):
8686
"""
8787

8888
EXT_SELF = None
89-
EXT_OWNERCOMP = tdu.Dependency(None)
89+
EXT_OWNERCOMP = None
9090

9191
PAR_EXEC = op('extParExec')
9292
DAT_EXEC = op('extParPropDatExec')
@@ -111,7 +111,7 @@ def Init(cls, extension_self, ownerComp: COMP, enable_properties: bool = True, e
111111
enable_stubs: bool = False) -> None:
112112
"""Initialize the CustomParHelper."""
113113
cls.EXT_SELF = extension_self
114-
cls.EXT_OWNERCOMP.val = ownerComp
114+
cls.EXT_OWNERCOMP = ownerComp
115115
cls.IS_EXPOSE_PUBLIC = expose_public
116116
cls.PAR_PROPS = par_properties
117117
cls.PAR_CALLBACKS = par_callbacks
@@ -120,7 +120,8 @@ def Init(cls, extension_self, ownerComp: COMP, enable_properties: bool = True, e
120120
cls.EXCEPT_CALLBACKS = except_callbacks
121121
cls.EXCEPT_SEQUENCES = except_sequences
122122

123-
me_me: textDAT = me # just to have autocomplete on this
123+
cls.__setOwnerCompToDocked(ownerComp)
124+
124125
cls.DAT_EXEC.par.active = enable_properties
125126

126127
if enable_properties:
@@ -136,6 +137,16 @@ def Init(cls, extension_self, ownerComp: COMP, enable_properties: bool = True, e
136137
else:
137138
cls.DisableStubs()
138139

140+
141+
@classmethod
142+
def __setOwnerCompToDocked(cls, ownerComp: COMP) -> None:
143+
for _op in me.docked:
144+
if hasattr(_op.par, 'ops'):
145+
_op.par.ops.val = ownerComp
146+
if hasattr(_op.par, 'op'):
147+
_op.par.op.val = ownerComp
148+
149+
139150
@classmethod
140151
def CustomParsAsProperties(cls, extension_self, ownerComp: COMP, enable_parGroups: bool = True) -> None:
141152
"""Create properties for custom parameters."""
@@ -157,7 +168,7 @@ def CustomParsAsProperties(cls, extension_self, ownerComp: COMP, enable_parGroup
157168
@classmethod
158169
def UpdateCustomParsAsProperties(cls) -> None:
159170
"""Update the properties for custom parameters."""
160-
cls.CustomParsAsProperties(cls.EXT_SELF, cls.EXT_OWNERCOMP.peekVal)
171+
cls.CustomParsAsProperties(cls.EXT_SELF, cls.EXT_OWNERCOMP)
161172

162173
@classmethod
163174
def _create_propertyEval(cls, extension_self, owner_comp: COMP, Parname: str, enable_parGroups: bool = True) -> None:
@@ -368,5 +379,5 @@ def UpdateStubs(cls) -> None:
368379
if cls.STUBS_ENABLED and cls.STUBSER is not None:
369380
# get class name from extension object
370381
class_name = cls.EXT_SELF.__class__.__name__
371-
op_ext = cls.EXT_OWNERCOMP.peekVal.op(class_name)
382+
op_ext = cls.EXT_OWNERCOMP.op(class_name)
372383
cls.STUBSER.StubifyDat(op_ext)

0 commit comments

Comments
 (0)