Pydrivers - Ipo Drivers defined by Python expressions #4155

Closed
opened 2006-04-29 17:23:12 +02:00 by Willian Padovani Germano · 2 comments

%%%This is the pydrivers patch I've been working on.

Pydrivers are part of Ton's Ipo Drivers. I was asked to provide the expression evaluation part for it and Martin had a related patch to eval py expressions entered in any text box, on which I based my first patch (thanks, theeth).

Been abusing his patch entry (#3101) for too long, better have this one specifically for pydrivers.

How to create pydrivers: in the Ipo window select any channel then open up the transform properties panel (press n) and click on "Add Driver", then on the small Python icon. Write your py expression in the text box that appears. This is already in Blender, the patch here has the eval part to make it actually work.

Some notes:

  1. Pre-loaded modules that can be used in the expressions: builtin, Blender (Blender, b), math (math, m), Blender.Noise (noise, n), and a text called pydrivers.py that you can create (pydrivers, p). Inside parenthesis are the aliases that can be used, so Blender.Get("curframe") and b.Get("curframe") are the same, for example.

  2. More aliases: ob("Cube") == Blender.Object.Get("Cube"). Equiv. for me and ma, for meshes and materials, respectively.

  3. To force re-evaluation of all pydrivers we'll need to add some menu entry or something. For now editing any pydriver expression will re-eval all of them and also reload the pydrivers.py Text, accounting for changes you made in it.

For examples of expressions and an idea of what pydrivers can do, check the sample .blend files (read the README texts inside them). The files are ready to be animated.

--
Willian%%%

%%%This is the pydrivers patch I've been working on. Pydrivers are part of Ton's Ipo Drivers. I was asked to provide the expression evaluation part for it and Martin had a related patch to eval py expressions entered in any text box, on which I based my first patch (thanks, theeth). Been abusing his patch entry (#3101) for too long, better have this one specifically for pydrivers. How to create pydrivers: in the Ipo window select any channel then open up the transform properties panel (press n) and click on "Add Driver", then on the small Python icon. Write your py expression in the text box that appears. This is already in Blender, the patch here has the eval part to make it actually work. Some notes: 1) Pre-loaded modules that can be used in the expressions: __builtin__, Blender (Blender, b), math (math, m), Blender.Noise (noise, n), and a text called pydrivers.py that you can create (pydrivers, p). Inside parenthesis are the aliases that can be used, so Blender.Get("curframe") and b.Get("curframe") are the same, for example. 2) More aliases: ob("Cube") == Blender.Object.Get("Cube"). Equiv. for me and ma, for meshes and materials, respectively. 3) To force re-evaluation of all pydrivers we'll need to add some menu entry or something. For now editing any pydriver expression will re-eval all of them and also reload the pydrivers.py Text, accounting for changes you made in it. For examples of expressions and an idea of what pydrivers can do, check the sample .blend files (read the README texts inside them). The files are ready to be animated. -- Willian%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#4155
No description provided.