[2023.1200, Windows] SceneChanger misleading debug warning

This is probably a very low-priority thing but take me some time since I thought there was something really wrong with my scene component.

Steps to replicate:

  1. Add sceneChanger from the palette to the project.
  2. In sceneChanger COMP click generate scene template.
  3. Copy the generated scene COMP to obtain the second scene
  4. Create a base COMP
  5. Coppy two created scenes into the base.
  6. Add the base COMP as the Scene COMP parameter in sceneChanger COMP.
  7. Set the Fade time parameter in sceneChanger to 0.
  8. Set the next scene parameter in sceneChanger to 1 and push the Fire Scene pulse button (to change the scene).

Result:
In the Textport there is the following debug warning:

/project1/base1/sceneTemplate1 may not be a valid scene component. Please check compliance 
  (Debug - DAT:/project1/sceneChanger/SceneChangerExt fn:SwitchToScene line:66)

Potential cause of the problem:

If block in lines 61-66 in the SceneChangerExt script results in an else statement when Fade time parameters are set to 0.

In

if fadeTime is None and hasattr(nSceneComp.par, 'Fadeintime'):

we got False since 0 is not None
and in

elif fadeTime:

we got False since fadeTIme == 0 and 0 is interpreted as False
so the else is executed.

best,
Milten

Good find thanks. Here is a fixed version. Let me know if you see anything regress. Otherwise this fix will end up in the next release.

sceneChanger.tox (23.7 KB)

Thanks for the fix.
It seems that everything is working properly now.

best,
Milten