[Bf-python] Make operators convenient and usefull

Roman Volodin roman.volodin at gmail.com
Mon Apr 6 14:00:16 CEST 2015


Hi everyone.
I have an idea/proposal to convert operators into class methods.
For now operators are not so convenient, I can't do something like:

obj = bpy.ops.mesh.primitive_cube_add(...)

And I have to worry about context (which is not quite clear for me to be
honest).
So I thought it'd be nice to use an operator as a class method, for example:

box = bpy.data.objects.primitive_cube_add(...)
instead of
bpy.ops.mesh.primitive_cube_add(...)

or

Fcurve.smooth()
instead of
bpy.ops.graph.smooth()

or

Constraint.set_inverse()               # (if Constraint.type == 'CHILD_OF')
instead of
bpy.ops.constraint.childof_set_inverse(constraint="Child Of",
owner='OBJECT')

I especially interested in last two, because I had to write my own
functions to avoid using ops.
Is it hard? Is it easy? Is it possible at all?

-Roman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20150406/8719f7b5/attachment.html>


More information about the Bf-python mailing list