Age | Commit message (Collapse) | Author |
|
blocks that were previously missed; and b) greatly increase my
ohloh stats!
|
|
There was an extraneous line causing ID property groups
to have the wrong length, causing crashes in code that
relied on it.
This commit both fixes that and adds a version check to
fix group lengths for older .blends. The subversion
was incremented to 15 for this change.
|
|
Kent
|
|
METH_VARARGS everywhere and getting the single args from the tuple.
Use METH_O where applicable.
|
|
(my fault) and in Effect module as well as a few others.
Also stopped using Py_BuildValue for strings, ints and floats.
|
|
The code for preserving ID properties was apparently not
working. Fixed that by adding a new function,
IDP_ReplaceInGroup, that automatically handles overriding a
property in a group while preserving the property order.
Its odd though that the previous fix I had wasn't
working :/
|
|
|
|
|
|
Updated id properties interface as per
discussed in python meeting. Basically,
id properties are now entirely accessed
through the dict-like interface if IDGroupType.
Also, tp_getsetters are used throughout the code
now.
Using the dict interface allowed for a major cleanup
of the wrapping code. The biggest change is that ID
properties are no longer wrapped in a structure with
.type .name and .data members; instead when you get
properties from the group it returns the direct value.
Ints, strings and floats return simple python types,
while arrays and groups return special wrappers though.
This means to detect the type of an ID property, you
have to use type(). For string and int types this is
easy; for group and array types (which of course have
their own wrappers) you use type() with Blender.IDGroupType
or Blender.IDArrayType.
Update of epydocs plus a temporary gui script will be
forthcoming; the gui script will be removed before release
as of course by then we'll have a built-in gui for id
properties.
|
|
BPy conventions were not being followed for PyObject_New;
now they are. I still doubt the usefullness of doing this,
however its important to maintain module standards.
Which reminds me, anyone know where I can get that source code
prettier that was used on the api files? It was kindof
hard following the coding style of bpy with it being so
different from normal blender, and also what with having
to write the IDProperty code from scratch. :)
|
|
Another bug from the tracker, reported by Mike Stramba.
A duplicated Py_XDECREF in the wrong place made assigning
arrays from Vector objects not work.
Also, fixed nasty bug in C API of idproperties (the function
to look up a property from a group was broken). Fixed a memory
leak too.
In addition, made "del group['property']" delete properties
from group; previously this would just crash (or at least it
should have). Added a small addition to the example in the
epydocs for IDGroup.
|
|
Fixed the bug of "print type(property)" crashed blender;
just needed to add PyType_Ready init code for all ID property
python types; I made a function IDProp_Init_Types and put
code to call it in types_initAll().
Also added GPL/BL headers to idproperty files.
|
|
Misspelled __members__ __member__ in IDProperty's
getattr function; this made "print dir(prop)" not
work. Eventually I need to replace the whole thing
with getsetters.
Still need to find out why "print type(a_property)" crashes
blender. :S
|
|
IDProperties was doing a name check where it shouldn't;
thise made executing "prop['value'] = something" not work
if the property 'value' already existed. Fixed it by
making the code replace existing properties, like it
should.
|
|
ID Properties binding have now been added for textures. Also,
the beginnings of supporting "del IDProperty Object" (which
basically removes the property from it's parent group then frees
it) in python were done; really the only thing now is to figure
out exactly *how* you overload the del operator. :S
|
|
IDProperties now have a sanity check to prevent different ID properties
in the same group from having the same name. The appropriate code has been
added to the python bindings to catch this and raise an error.
|
|
This commit adds supports for per-ID properties to blender.
See http://mediawiki.blender.org/index.php/BlenderDev/ID_Property
for more information on how it all works.
ID properties are accesable by python; but note that
bindings have only been added to Object and Material thus
far. However adding more bindings is easy and I plan
on adding several more hopefully within an hour of this inital
commit.
A generic UI panel is also planned, that will go wherever its
needed; for example in the material buttons, editing buttons, etc.
I'll likely submit the initial code for that as a patch, though,
so matt and ton and others can go over it and make sure it's
all good. :)
VERY important, if you intend to use ID properties please
go to http://mediawiki.blender.org/index.php/BlenderDev/PropertyStandards
and start writing the appropriate standards for it.
|