Commit Graph

297 Commits

Author SHA1 Message Date
ec29a844f9 == RNA ==
Ongoing work in rna_ipo.c: wrapping BPoint and BezTriple, since they are used in IpoCurve.

These are declared in DNA_curve_types.h, so rna_curve.c is a better place for them. I prefer to test things better and have someone who knows well this data check the wrapping first, though.
2008-12-29 18:38:29 +00:00
e51827246d RNA
* DNA_object_fluidsim.h: done, patch by Nathaniel Garbutt, thanks!
  Some changes to make it more complete and adding inheritance to
  better hide irrelevant and reused properties.
* Also added all derived types for modifiers, but only fluid is
  filled in currently.
* Some files converted from DOS to UNIX line endings.
2008-12-29 17:36:06 +00:00
82cf2aebba RNA:
* 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;
2008-12-26 20:38:52 +00:00
2431c6667c * Added bSound to rna (still need to do bSample and bSoundListener structs)
* rna epy doc-gen was failing when trying to sort None
2008-12-26 16:50:05 +00:00
0054e6d354 * added RNA_property_as_string to rna_access.c - can print most types except for pointers and collections.
* WM_operator_pystring to print the python func+args for an operator
* call WM_operator_print(op) in wm_operator_invoke(), simple echo mode should be moved later.
2008-12-26 03:56:52 +00:00
bc5b56e2a8 RNA
* RNA_enum_is_equal function to quickly compare with enum identifier name.
2008-12-24 10:50:39 +00:00
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
9f06ed1b36 RNA: start of wrapping for Constraints
Still need to find out how to get the variable struct-type for constraint->data to work correctly. Any ideas brecht?
2008-12-12 23:30:23 +00:00
b9e04c67dc RNA: Start of RNA wrapping for Armatures
Wrapped most of Armature settings, but bones are not yet complete.
2008-12-09 11:29:40 +00:00
6241b8a57f RNA
* rna for DNA_key_types.h, also linked to key member of Lattice, others need to be checked.
2008-12-03 21:18:10 +00:00
8f1847e4c3 RNA: review of commits in the past days, check the diffs for the
many small changes, but the two bigger ones are:

* Sensors and controllers now use inheritance, rather than pointing
  to the data in a separate struct. Had to add some new RNA define
  functionality to support this better.
* DNA_meta_types.h was marked as done but still missing many things,
  now completed.
2008-12-02 23:45:11 +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
6780c0b12a * rna_property completed
CAUTION: some defines like PROP_INT in DNA_property_types.h are the same 
as enums in RNA_types.h, and may be encounter hidden errors in future.
2008-12-02 01:05:23 +00:00
23a77e7688 RNA
* DNA_packedFile_types: added rna definitions for packed files
* also experimentally filled in correct struct 'PackedFile' in image rna for testing.
* updated MSVC projectfiles (also for rna_curve.c and rna_vfont.c)

Note:
I removed PackedFile->flags, I did grep through source and a complete recompile of blender trunk svn without them too, so they obviously aren't needed anymore. A bit of cleaning up :)
2008-12-01 21:23:58 +00:00
1ebf257bf4 RNA: Curves and VFont
Implemented RNA wrappers for curves and VFont. Only issue I could
not yet solve is related to struct CharInfo curinfo; . This particular
line proved to be hard to wrap and I therefore marked it as a TODO
should someone want to fix this issue.

I also cleaned up makesrna.c a bit by unifying brush/meta parts
under one call just the way it is done in the case of other
wrappers.
2008-12-01 19:02:27 +00:00
5a8e8906bb RNA:
Implemented RNA wrapper for ModifierData.

Note that actual interface to access data of any specific modifier is
still missing. I also marked a couple of parts as TODO that should be
reviewed to decide whether or not to expose those specific parts
via RNA.
2008-12-01 13:01:48 +00:00
12a45b3174 RNA: brush wrapping
Wrapped most of brush. Brush is still missing a link to texture and to
BrushClone. Also PAINT_TOOL_DRAW etc. flags found on DNA_brush_types.h
need to be associated to a brush somehow. Currently they are linked
to a brush via ImagePaintSettings.

Also changed identifiers in metaball wrapping to conform with the
standards.
2008-12-01 06:52:18 +00:00
669c7a9922 RNA
* Tiny updates/fixes to Ipo wrapping.
2008-12-01 00:48:54 +00:00
3f0d3e0a50 RNA
- Minor updates to Camera and start of Ipo (+ IpoDriver and IpoCurve) wrappings.
2008-11-30 23:27:10 +00:00
e66fff7906 * added rna_world with porperties of two first panel in the current UI 2008-11-30 22:48:43 +00:00
cfa5c7c396 RNA: Support for Metaballs and Metaelements. I did not figure out a way to test latter but hopefully it works as well. 2008-11-30 20:18:55 +00:00
255bc067ec * changed NULL properties into UnknownProperty
* added rna_property.c and rna_actuator
* enabled access to properties and actuators from object
Note that because we have RNA_Property in the RNA itself, you can find 
properties in gamelogic of and object under the name of RNA_GameProperty
2008-11-30 19:52:21 +00:00
9cb9bf7da3 RNA:
* DNA_image_types.h done, except for some properties not being editable.
2008-11-30 18:39:49 +00:00
a141e44e55 RNA
* DNA_lattice_types: added rna definitions for lattice u,v,w and some flags
* updated MSVC projectfiles
2008-11-30 16:38:56 +00:00
42aa747ec0 RNA
* DNA_radio_types.h: done. (patch by Jorge Bernal). Also adds
  some #defines in the radiosity DNA since it was using hardcoded
  values.
* Added an "UnknownType" which has no properties, useful as a
  placeholder for pointers that have no defined type yet.
* Sort a few lists in the code alphabetically.
2008-11-30 15:55:14 +00:00
5464c2e4a8 * controller structs, bController, bExpressionCont and bPythoncont RNFied\n*controllers are available in objects\n* some typos in rna_sensor 2008-11-30 14:40:00 +00:00
970fa83fab Added Group type to RNA 2008-11-30 05:07:57 +00:00
bc68cb7985 added all sensor types without their properties and full RNAfy bNearSensor, bMouseSesnsor, bTouchSensor, bAlwaysSensor 2008-11-29 22:16:23 +00:00
fc20b87768 RNA
Adding support for Cameras. Work in progress, I'm still learning about RNA.
2008-11-29 19:53:49 +00:00
3b59a18f53 more rna_sensor codes 2008-11-29 16:07:49 +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
Nathan Letwory
4fc369564a * more work on screen 2008-11-29 13:57:19 +00:00
344d9f1e6a add initial codes for rna_sensors 2008-11-29 02:01:39 +00:00
Nathan Letwory
6cb554fa96 * start RNA_screen
* nicer RNA names for NodeTree and Node
2008-11-29 01:04:15 +00:00
Nathan Letwory
af30c87dee * make sure Material and bNodeTree datablocks show up properly in RNA Viewer.
- documentation was a bit outdated and missing a step, so I updated http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA#Struct to reflect the current state.
2008-11-27 13:36:28 +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
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
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
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
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