View Full Version : Python: first use: failure

06-07-2012, 10:09 PM
So I decide to try the Python feature.

In Layout, hit the PYTHON button, navigate a bit, and click on "basic_barn.py". Error.

Figure it's probably something for a light, select a light, run: Error.

Change light type to SPOTLIGHT. Error.

Try the "basic_barn.pyc" -- maybe it wants the compiled one. Error.

Try looking at the code to see if there's any hint. No explanation of the function of the script.

Attached is an image of the error message. I have no idea what it means.

"Could not locate a defined factory class that inherits from "IGenericFactory"!

Shouldn't using scripts be easier than this?

06-07-2012, 11:13 PM
It's the first time I run Python.
Use Add Plugins on these .py ;)
f.e. Python Master Test..

You can run only what is Generic- because these are not handlers, just commands..

Handlers must be used from appropriate panel such as Master Plugins window etc.

06-08-2012, 01:31 AM
Hmmm, is this mentioned anywhere in the dox?

As an "out of box experience", not so good.

06-08-2012, 03:07 AM
The Error Message stats clearly what the problem is. It cannot locate a defined factory class which is inherited from IGenericFactory. I assume IGenericFactory is an interface which cannot get implemented cause not found, maybe wrong execute environment.

The question stays the same though. Why is this happening? The question should be, how to use this script? I don't have LW 11 so I can't say, but is there no mentioning of how to use Python scripts in the LW11 manual?

07-06-2012, 06:36 PM
Only "Generic" python script can be executed in the python dialog from utilities menu of Layout. "ItemMotion" python scripts are executed from motion menu (shortcut 'm'). I guess Master, Shader, ... have their own menus to be executed.

07-08-2012, 12:16 AM
Sounds like the innards of LW needs a bit of polishing then. There is no reason why an error is to be reported, it should know what type of script it is and apply it. Error reports should be reserved for the unknown.

07-10-2012, 06:25 PM
There's been some discussion of this and the solution, at least for the moment, seems to be developers will need to make sure they put good comments in the .py scripts to ensure those whom aren't developers can run them no problem. Should LW tell the user, "Hey, you need to run this script through here instead"? Probably, but for the moment comments make good docs.

I know this doesn't solve the immediate issue, this is a moving forward comment.