[Bf-committers] parsing Blender and math expressions?

Campbell Barton ideasman42 at gmail.com
Fri Apr 30 09:32:39 CEST 2010


While not against this (in general), keeping them fast is very
important since they can be evaluated 100's (even 1000's) of times a
second when running an animation on a complex rig.
Since 2.4x, drivers compile their expressions giving ~15-25x, As well
as caching the namespace (also gives some speedup), so I'd not accept
a solution that is significantly slower.

On Fri, Apr 30, 2010 at 9:11 AM, Benjamin Tolputt
<btolputt at internode.on.net> wrote:
> Toni Alatalo wrote:
>> Triggered by the crazily exploded security/sandboxing talk, I looked a
>> bit into what kind of mathematical expression parsers etc. there are for
>> Python... <snipped details>
>
> This would be a reasonable compromise in my opinion. It is how
> expressions are used in alternate 3D packages such as Lightwave & XSI. A
> majority of the expressions I use are simple mathematical equations
> taking in the current location/orientation of other bones/objects in the
> scene.
>
> Whether or not it bumps up against the position of "only standard Python
> in Blender" depends on how strict the developers are about it. If they
> only mean that in the case of not customising the Python runtime &
> related code - this would fit that definition without problems
>
> With that in mind, it does make you wonder why we cannot use the logic
> nodes (or similar) for the problem. That would allow you together what
> you need whilst referencing only the elements of functionality that the
> logic nodes make available - scene data, mathematical expression, and
> conditionals. If this was to be classified as worthwhile, a "nodes to
> Python subset" and it's inverse would be quite useful in the Game Engine
> as well.
>
> Worth noting in the meeting topic Campbell has proposed.
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
- Campbell


More information about the Bf-committers mailing list