Commit Graph

23 Commits

Author SHA1 Message Date
04428d6750 added "description" and "readonly" properties to RNA Structs (also accessible via python)
Many descriptions are not written, grep for DOC_BROKEN if you have some spare time to write struct descriptions.
2008-12-19 04:06:24 +00:00
c1379f6613 UI:
* Added support for defining properties for operator buttons, with
  uiButGetOperatorPtrRNA. Needed to cleanup a hack that was there
  for operator properties in RNA, now a separate OperatorProperties
  type is used for storing operator properties, instead of being part
  of the Operator type itself.
* Allow selecting menu items with mouse release instead of press again.
* Fix some cases with hanging tooltips in the UI.
2008-12-16 20:03:28 +00:00
c13bb258b1 RNA:
Added some functionality to make inspecting all RNA structs possible. Not used
yet, but can be tested by replacing this line in space_outliner.c:

RNA_main_pointer_create(G.main, &cell.ptr);

with:

RNA_blender_rna_pointer_create(&cell.ptr);
2008-12-15 13:46:50 +00:00
9f27be3b2d Added RNA functions from PyRNA
* RNA_property_enum_value
* RNA_property_enum_identifier
To get an enum string from a value and a value from an enum.

BPy_StructRNA types (objects, meshes, images etc) can now be used as dictionary keys.
2008-12-02 14:36:35 +00:00
bc99bbde21 mistake in comparing pointers. (causing memfree prints) 2008-11-30 02:30:34 +00:00
2b7e390967 RNA
* Fix sensor data pointer code, also made sensor type non editable,
  would need to do more work than just setting the type.
* Fix a fairly obscure bug related to inheritance and sorting.
* Complete DNA_ID.h wrapping, just a few extra properties and the
  Library struct, most of this is internal.
2008-11-29 19:08:46 +00:00
cc0fdf24a9 * Fix Makefiles to compile python.
* Tweak SConscript priorities to link ed_util.
* Added RNA_struct_is_ID function for python.
2008-11-29 15:43:53 +00:00
97dcbbf886 RNA
* Added more lamp properties. (patch by Michael Fox)
* Fix a number of warnings in the RNA code.
* Converted DOS line endings to UNIX.
* Added some information on defining ID structs, and fixed use
  of "ID" inheritance for some non-ID structs.
* Added text on naming conventions to the RNA documentation, and
  applied it to the current code.

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA#Naming_Conventions
2008-11-29 14:35:50 +00:00
e384ad573a RNA
* Made auto collection wrapping work for ** arrays.
  (Mesh.mats, still points to ID since there is no Material yet).
* Added sorting of RNA structs/properties before writing.
2008-11-26 22:24:26 +00:00
2a8484bc24 RNA
* Disable editable pointers for now, difficult to support well.
* Swap parameters in RNA_access.h functions to make it more
  consistent.
* Rename rna members for operators to wmOperatorType.srna, and
  wmOperator.ptr, to make the distincton a bit clearer.
• Removed the RNA_int_default and similar functions, they're too
  confusing. RNA_property_is_set can still be used to achieve
  the same goal.
* Add functions to create RNA pointers.

Some example code for RNA data access and operator properties:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNAExampleCode
2008-11-24 15:51:55 +00:00
b863bf98e5 RNA
* Wrap most user editable data in DNA_mesh_types.h and DNA_meshdata_types.h.
  Still needs to be improved in some areas though, especially how to deal
  with data layers (expose per element or as array, or both?), and data in
  face corners (bmesh type data structures are more logical here).

Tweaks to RNA defining to make some cases easier:
* Added range callback function for int/float.
* Added 'skip' callback for listbase and array iterators to skip items in
  the collection.
* Extra error print when calling wrong define_property_*_sdna functions.
* Also made button code respect non_editable flag, is quick change though,
  need to add support for properly graying out etc.
2008-11-24 12:12:24 +00:00
c6da2a59d8 RNA
* Added RNA for operators. This still uses ID properties internally,
  but through the RNA API now. The OP_get/set_* API that was used is
  replaced by the RNA API. Currently RNA properties for operators are
  defined at runtime since it means operator registration can be done
  in a single function.
* Changed the existing operators to use this system, I haven't defined
  user interface names yet though. I also think there need to be some
  conventions on which properties to expose to make these operators
  usable in macros, for example if mouse coordinates should be stored
  or not.
* When using ID properties through defined RNA properties, it now
  checks that the ID property actually matches the RNA property and
  removes/overwrites it otherwise. This ensures that you can safely
  get/set arrays for example without having to worry that some
  external thing may have changed the length.
* Documentation now has some information on RNA + ID properties.

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA
2008-11-21 19:14:38 +00:00
129585285c RNA
* More ID property support. What was already possible was showing
  ID properties as RNA properties. Now it is possible to define
  RNA properties and have an ID property automatically created the
  first time it is set (if not set it retuns the default).

* Added support for defining RNA structs and properties at runtime.
  This is useful for python and plugins, and could also be used
  for operators, not sure yet what is best there, they could be done
  in preprocess for speed, but not sure how to do that while keeping
  operator registration a single function.

* Added quick functions to get/set properties based on names, to be
  used for operators.

* Added some simple support for inheritance, was already doing this
  but having it as a feature simplifies things. Two things were added
  for this: when defining a struct you can give a 'from' struct whose
  properties will be copied, and structs like ID, operator, modifier,
  can define a refine callback that will return the more specific type
  of the struct like ID -> Object, Mesh, .. .

* Added simple windowmanager wrap with only the registered operators
  list, used for testing RNA for operators.
2008-11-21 02:23:46 +00:00
c3da1af01c RNA minor changes
* Added start of lamp wrapping (code by Michael Fox).
* Add back Object.data, was crashing with unknown data type.
* Added support for using consecutive variables like float r, g, b;
  as an array without writing a manual get/set function.
* Also note the RNA documentation is updated now to be more
  about how to define RNA and use it, including some diagrams.

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA
2008-11-18 10:57:06 +00:00
623421d580 RNA
* Added support for ID properties, mapped as follows:
	* IDP Int = RNA Int
	* IDP Float, Double = RNA Float
	* IDP_String = RNA String
	* IDP Group = RNA IDPropertyGroup Struct
	* IDP_Array = RNA Array

* PropertyRNA and StructRNA are now defined private for the module,
  to force external code to always use accessor functions.
2008-11-17 18:44:06 +00:00
a2cc29d221 RNA
* Rename cname to identifier.
* Rename PropertyEnumItem to EnumPropertyItem.
* Wrapped min/max/step/precision, pointer type for RNA.
* Draw FLT_MAX a bit better in buttons.
2008-11-14 18:46:57 +00:00
a2175968a7 RNA
* Added RNA list viewer. This is currently drawn in the outliner
  window, the UI is limited but it is just intended to test RNA
  at the moment.
* Added UI names for currently wrapped properties.
* Made iterating collections a bit more convenient.
2008-11-14 17:05:25 +00:00
4a8e571e8d RNA
* Added accessor functions for structs and properties instead of
  direct access, in preparation of wrapping ID properties.
* Added more error prints for wrong defines.
* Wrap RNA data structures with RNA.
* Disable dependency code for now to avoid confusion.
2008-11-14 14:34:19 +00:00
44f94f7927 * Compile fix for RNA + makefiles.
* Fix for bug in collection string lookup function.
2008-11-11 18:28:00 +00:00
3bb5fc9c7d * RNA: utility function to retrieve strings. It will use a fixed
size buffer if it's big enough, and otherwise allocate memory.
* Added BLI_dynstr_appendf() to construct strings easily in printf
  style, this should make it easier to construct menu strings for
  example.
2008-11-11 15:03:26 +00:00
7e8ba5c84d RNA
* Added more error prints for wrong definitions, for cases that
  would laters cause problems compiling or crash at runtime, and
  also made messages more clear.
* Added some skeleton code for main/ID/mesh/vertex types for testing.
* Added support for automatic arrays as collections using SDNA.

* Changed how pointers to data work. Now they are always wrapped
  in a PointerRNA struct, which contains the data pointer and type,
  and also the data pointer and type of the ID datablock that this
  belongs to, since for example a vertex on it's own may not have
  enough information for some operations, it also needs the mesh.

* Added some code for defining dependencies with RNA, and looking up
  data with paths like: scenes[0].objects["Cube"].data.verts[7].co.
  Note sure either will end up being used, this is experimental.

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA
2008-11-07 02:58:25 +00:00
21a0e55c50 RNA compile error and warning fixes for MSVC. 2008-11-01 00:23:08 +00:00
7f24dbe5fc RNA / Data API
This is the first code for the Data API, also known as RNA system in the
2.5 Branch. It does not include a user interface, and only wraps some
Scene properties for testing. It is integrated with Scons and Makefiles,
and compiles a 'makesrna' program that generates an RNA.c file.

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataAPI
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA

The changes are quite local, basically adding a makesrna module which
works similar to the makesdna module. The one external change is in
moving genfile.c from blenloader to the makesdna module, so that it can
be reused by the RNA code. This also meant changing the DNA makefiles.
It seems to be doing dependencies correct still in my tests, but if
there is an issue with the DNA not being rebuilt this commit might be
the one causing it. Also it seems for scons the makesdna and makesrna
modules are compiling without warnings. Not a new issue but this should
be fixed.

The RNA code supports all types as defined in the Data API design, so
in that sense it is fairly complete and I hope that aspect will not
have to change much. Some obviously missing parts are context related
code, notify() functions for updates and user defined / ID properties.
2008-10-31 23:50:02 +00:00