Changeset - 47f7f5ac81e8
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 months ago 2023-06-02 23:15:20
drewp@bigasterisk.com
skip effect compute if we have no devs for the effect
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
light9/effect/effecteval2.py
Show inline comments
 
@@ -83,24 +83,27 @@ class EffectEval2:
 
        calls our function using inputs (publishedAttr attrs, e.g. :strength)
 
        and effect-level settings including a special attr called :deviceSettings
 
        with DeviceSettings as its value
 
        """
 
        if self.config is None:
 
            return DeviceSettings(self.graph, [])
 

	
 
        c = self.config
 
        kw = {}
 
        for arg in c.funcArgs:
 
            if arg.annotation == DeviceSettings:
 
                v = c.devSettings
 
                if v is None: # asked for ds but we have none
 
                    log.debug("%s asked for devs but we have none in config", self.uri)
 
                    return DeviceSettings(self.graph, [])
 
            elif arg.name == 'songTime':
 
                v = songTime
 
            else:
 
                eaForName = EffectAttr(L9[arg.name])
 
                v = self._getEffectAttrValue(eaForName, inputs)
 

	
 
            kw[arg.name] = v
 
        log.debug('calling %s with %s', c.func, kw)
 
        return c.func(**kw)
 

	
 
    def _getEffectAttrValue(self, attr: EffectAttr, inputs: EffectSettings) -> VTUnion:
 
        c = self.config
0 comments (0 inline, 0 general)