[Bf-extensions-cvs] a push to make blender scripts less complex

Tcll tcll5850 at gmail.com
Sun Jun 8 21:17:21 CEST 2014


I just wanted to bring this up as for the fact that I've written a program
because of blender's complexity...
and that was back with the B24x release...

after playing around with a B26 release and trying to build an importer for
it, I couldn't wrap my head around the complexity of things, and just
decided to continue working on my program...

with enough experience on this issue, I can boast that you need a good 70%
less code for my scripts than you would for a Blender script...


I'm achieving this with user-interrupted automation where needed,
and providing single-level functions to do the dirty work of the interface
management...
(the only thing I'm providing a class for is my switch/case/default
implementation, because python needs this.)


the whole implementation for my program follows an interruptable
fixed-function implementation.

also, the setup for the script involves calling a single function for each
case this script is used in.

I hope to get you guys to improve on this with better ideas... :/
70% is alot of unneeded code for what your program does...
and my program only does a small fraction of it.


one thing I could suggest is that for import/export scripts you automate
the transactions given to the interface.

for an example, I'll use my interface:

    SID = ugeSetScene("base_scene")

    #here's the interruptable part:
    OIDs = [ugeSetObject() for i in range(ObjectCount)]
    for OID in OIDs:
        ugeSetObject(OID)
        ugeSetObjectName("Object_"+OID.__str__())
        ugeSetObjectLoc([0.0,0.0,0.0])

notice a similarity between my interface and how OpenGL runs?? :)

one thing wrong with my interface though is a single object can only hold
just 1 type of data.
in my case, meshes...
where I've recently seen how a blender object can hold multiple meshes...
I'm not sure if this applies to anything else with blender, but I can adapt
my interface to match. :)

(I'm trying to follow the modern guidelines)

if you guys would like to know more about my interface as to how you could
adapt simple methods to your interface, please let me know. :)


but yea, I think blender would benefit much better if the scripting
interface was made ALOT simpler. ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-extensions-cvs/attachments/20140608/10adc090/attachment.htm 


More information about the Bf-extensions-cvs mailing list