@@ -196,7 +196,7 @@ def setDirty(self, dirty: bool) -> None:
196196 # result of evaluating that property with the current stack. If you need the
197197 # actual function, use getRawProperty()
198198 def getProperty (self , key : str , property_name : str , context : Optional [PropertyEvaluationContext ] = None ):
199- value = self .getRawProperty (key , property_name )
199+ value = self .getRawProperty (key , property_name , context = context )
200200 if isinstance (value , SettingFunction ):
201201 if context is not None :
202202 context .pushContainer (self )
@@ -222,18 +222,28 @@ def getProperty(self, key: str, property_name: str, context: Optional[PropertyEv
222222 # \return The raw property value of the property, or None if not found. Note that
223223 # the value might be a SettingFunction instance.
224224 #
225- def getRawProperty (self , key , property_name , * , use_next = True , skip_until_container = None ):
226- for container in self ._containers :
225+ def getRawProperty (self , key , property_name , * , context : Optional [PropertyEvaluationContext ] = None ,
226+ use_next = True , skip_until_container = None ):
227+ containers = self ._containers
228+ if context is not None :
229+ # if context is provided, check if there is any container that needs to be skipped.
230+ start_index = context .context .get ("evaluate_from_container_index" , 0 )
231+ if start_index >= len (self ._containers ):
232+ return None
233+ containers = self ._containers [start_index :]
234+
235+ for container in containers :
227236 if skip_until_container and container .getId () != skip_until_container :
228237 continue #Skip.
229238 skip_until_container = None #When we find the container, stop skipping.
230239
231- value = container .getProperty (key , property_name )
240+ value = container .getProperty (key , property_name , context )
232241 if value is not None :
233242 return value
234243
235244 if self ._next_stack and use_next :
236- return self ._next_stack .getRawProperty (key , property_name , use_next = use_next , skip_until_container = skip_until_container )
245+ return self ._next_stack .getRawProperty (key , property_name , context = context ,
246+ use_next = use_next , skip_until_container = skip_until_container )
237247 else :
238248 return None
239249
0 commit comments