[Bf-python] Scriptlink limitations

Campbell Barton cbarton at metavr.com
Thu Feb 1 05:06:22 CET 2007


one of the things that stop me from using scriptlinks more often is that 
theres no way of telling what launched the scriptlink.

The most common case is that you have an object scriptlink and you want 
to refer to that object within the scriptlink.

Could we have a variable Blender.linkdata - so the data that triggers 
the scriplink is assigned to that? - camera/scene/world/object, whatever.

It would be important to note that this variable may change if the 
script did an operation that ended up calling another data's scriptlink 
(render for instance)

So you would need to define the data at the start of the script.

import Blender
self = Blender.linkdata
if type(self) != Blender.Types.ObjectType:
    ....


What do you think?



More information about the Bf-python mailing list