[Bf-python] Scriptlink limitations

Toni Alatalo antont at kyperjokki.fi
Fri Feb 2 16:00:42 CET 2007


Joe Eagar kirjoitti:
> IMHO, I think we should kill scriptlinks in favor of a more generic 
> and usable plugin 

scriptlinks are quite usable. i think the event refactor may lead to 
ways of expaning it, instead of killing it. but of course the design can 
be reconsidered too.

> with scriptlinks is either the user or the script author to make them, 
> and they tend to only exist on either the scene level or (worse) the 
> area space level.

i dont think these things are true nor make them useless. i have found 
object scriptlinks most useful. they are nice for animation, and there 
things like UI events you mentioned (selection state) are irrelevant.

> Campbell Barton wrote:
>> one of the things that stop me from using scriptlinks more often is 
>> that theres no way of telling what launched the scriptlink.
this is not true:
http://www.blender.org/documentation/242PythonDoc/Blender-module.html#link

"""
link

   for normal script links, 'link' points to the linked Object (can be a 
scene, object (mesh, camera, lamp), material or world).
"""

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

so we certainly could, as it is there already, just the name is 'link' 
and not 'linkdata' which i think is good, 'cause it is object level and 
not obdata level and you can of course always get data related to an 
object via it.

>> 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)

i am not sure how that behaves now. like mentioned above i've used 
scriptlinks mostly for animation.

>> What do you think?

we should put some highlight tutorial up pointing this out?-)

~Toni





More information about the Bf-python mailing list