Age | Commit message (Collapse) | Author |
|
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
|
|
Mostly harmless ones, except for one about "gzopen64" being
undeclared. This needs some defines in BLI_storage.h to be set
before <unistd.h> is included. Might fix a crash in compressed
file reading, though I'm not sure since it's hard to repeat
the crash consistently.
|
|
* Automatic shortcut keys in menus now compare operator properties as well.
Implemented IDP_EqualsProperties for this.
* I imagine all these compares may be a bit slow, for this case it's not
so bad though because it only happens for one menu when it is opened.
|
|
- wm draw method is now initialized correct when reading older
files, but the SDNA bug causing the problem is still unsolved.
is due to // char pad[8]; not being recognized as commented.
- triple buffer proxy texture test follows spec better now,
was disabling triple buffer unnecessarily on some drivers.
- some cmake compile fixes related to sequencer pthread usage
and removed bad level calls lib for player.
- show outliner header buttons in oops mode as well until that
can be switched in the UI.
- fix region data free issue for tooltips
- warning fixes
|
|
* Store RNA collections different in ID properties, using a generic
ID property array, using the patch provided by Joe.
* Fix bug accessing registered operator properties in the wm from the
outliner.
* In the outliner, only use the RNA icon for RNA data, and use dot
again for unknown icon.
* Also, show pointer properties data in the second column, and auto
expand two levels when opening them.
* Added small RNA_struct_defined_properties function to get only the
defined properties without builtin and undefined id properties
(for py operators).
|
|
* Added support for using pointers + collections as operator properties,
but with the restriction that they must point to other type derived from
ID property groups. The "add" function for these properties will allocate
a new ID property group and point to that.
* Added support for arrays with type IDP_GROUP in ID properties.
* Fix bug getting/setting float array values.
Example code for collections, note the "OperatorMousePath" type is defined
in rna_wm.c and has a float[2] property named "loc".
Defining the operator property:
prop= RNA_def_property(ot->srna, "path", PROP_COLLECTION, PROP_NONE);
RNA_def_property_struct_runtime(prop, &RNA_OperatorMousePath);
Adding values:
PointerRNA itemptr;
float loc[2] = {1, 1},
RNA_collection_add(op->ptr, "path", &itemptr);
RNA_float_set_array(&itemptr, "loc", loc);
Iterating:
RNA_BEGIN(op->ptr, itemptr, "path") {
float loc[2];
RNA_float_get_array(&itemptr, "loc", loc);
printf("Location: %f %f\n", loc[0], loc[1]);
}
RNA_END;
|
|
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416
Issues:
* GHOST/X11 had conflicting changes. Some code was added in 2.5, which was
later added in trunk also, but reverted partially, specifically revision
16683. I have left out this reversion in the 2.5 branch since I think it is
needed there.
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683
* Scons had various conflicting changes, I decided to go with trunk version
for everything except priorities and some library renaming.
* In creator.c, there were various fixes and fixes for fixes related to the -w
-W and -p options. In 2.5 -w and -W is not coded yet, and -p is done
differently. Since this is changed so much, and I don't think those fixes
would be needed in 2.5, I've left them out.
* Also in creator.c: there was code for a python bugfix where the screen was not
initialized when running with -P. The code that initializes the screen there
I had to disable, that can't work in 2.5 anymore but left it commented as a
reminder.
Further I had to disable some new function calls. using src/ and python/, as
was done already in this branch, disabled function calls:
* bpath.c: error reporting
* BME_conversions.c: editmesh conversion functions.
* SHD_dynamic: disabled almost completely, there is no python/.
* KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled.
* text.c: clipboard copy call.
* object.c: OB_SUPPORT_MATERIAL.
* DerivedMesh.c and subsurf_ccg, stipple_quarttone.
Still to be done:
* Go over files and functions that were moved to a different location but could
still use changes that were done in trunk.
|
|
its type), then crash.
http://blenderartists.org/forum/showthread.php?p=1228670#post1228670
|
|
|
|
|
|
* subsurf code had a lot of unused variables, removed these where they are obviously not needed. commented if they could be useful later.
* some variables declorations hide existing variables (many of these left), but fixed some that could cause confusion.
* removed unused vars
* obscure python memory leak with colorband.
* make_sample_tables had a loop running wasnt used.
* if 0'd functions in arithb.c that are not used yet.
* made many functions static
|
|
use them by default
|
|
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.
|
|
|
|
|
|
bad level calls. (which is not finished at all)
|
|
ID Properties weren't being duplicated (by shift-D or any of the other
duplication functions). So now ID properties are duplicated in the
main copy_libblock function, which (as far as I can check) covers all
ID-contained ID properties.
I also updated the constraint system to copy pyconstraint ID properties
on shift-D.
This would probably be a good thing to add to the stable branch, btw.
|
|
At last! The ability to code constraints in Python. This opens up many interesting rigging possibilities, as well as making prototyping constraints easier.
* A PyConstraint script must begin with the line
#BPYCONSTRAINT
* It must also define a doConstraint function, which performs the core actions of the constraint.
* PyConstraints use IDProperties to store custom properties for each PyConstraint instance. The scripter can choose which of these ID-Properties to expose to a user to control the behaviour of the constraint. This must be done using the Draw.PupBlock method.
Credits to Joe Eager (joeedh) for coding the original patch on which this is based. I've made heavy revisions to large parts of the patch.
For more detailed information, and some demo scripts, see the following page:
http://aligorith.googlepages.com/pyconstraints2
|
|
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 :/
|
|
The array resizing function, meant to be used with strings,
didn't work. This is because the id property size table
had the wrong value for strings.
|
|
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.
|
|
IDP_GroupIterNext returned void* rather then IDProperty*.
Made it IDProperty*.
BTW, any people out there interested in using IDProperties
from the C side, feel free to email me comments and (especially!)
file bugreports assigned to me in the tracker. :)
|
|
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.
|
|
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 file reading/writing of ID properties to all ID types,
and also adds python access for NMesh, Mesh, Scene and Image. Note
that the file reading code might need some more work for certain
future/planned features to save right. Also I updated a few comments in idprop.c.
|
|
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.
|