I'm making a rig that has a python interface and I was wondering if their was anyway to append the rig and the script at the same time so the script runs as soon as it's appended.
Asked
Active
Viewed 855 times
1 Answers
1
If you do this manually, you need to run the script after it is linked. The script auto-runs only on file open/reload (if it is registered).
You can write an addon, that will link your character, create proxy rig from it, link the script and run the script:
You make proxy rig like this:
# get your linked group object objects = bpy.context.scene.objects group_ob = objects.get('Character') # <- you probably have this from linking already # create proxy rig objects.active = group_ob bpy.ops.object.proxy_make() # get the proxy object if you need proxy_ob = bpy.context.active_objectRunning the script is easy:
script = bpy.data.texts.get("rig_script.py") # <- you have this from linking exec(script.as_string())
Jaroslav Jerryno Novotny
- 51,077
- 7
- 129
- 218