[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18266] branches/blender2.5/blender/source /blender: RNA

Brecht Van Lommel brecht at blender.org
Fri Jan 2 17:58:10 CET 2009


Revision: 18266
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18266
Author:   blendix
Date:     2009-01-02 17:58:09 +0100 (Fri, 02 Jan 2009)

Log Message:
-----------
RNA
* DNA_object_types.h done.
* Scriptlink skeleton added.
* Fix cmake compile.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
    branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
    branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt
    branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c

Added Paths:
-----------
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_scriptlink.c

Modified: branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c	2009-01-02 15:49:31 UTC (rev 18265)
+++ branches/blender2.5/blender/source/blender/editors/space_outliner/outliner.c	2009-01-02 16:58:09 UTC (rev 18266)
@@ -3248,6 +3248,8 @@
 		return ICON_RNA;
 	else if(rnatype == &RNA_ObjectGameSettings)
 		return ICON_GAME;
+	else if(rnatype == &RNA_ScriptLink)
+		return ICON_PYTHON;
 	else
 		return ICON_DOT;
 }

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2009-01-02 15:49:31 UTC (rev 18265)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2009-01-02 16:58:09 UTC (rev 18266)
@@ -178,6 +178,7 @@
 extern StructRNA RNA_ScrEdge;
 extern StructRNA RNA_ScrVert;
 extern StructRNA RNA_Screen;
+extern StructRNA RNA_ScriptLink;
 extern StructRNA RNA_Sensor;
 extern StructRNA RNA_Sequence;
 extern StructRNA RNA_SequenceColorBalance;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt	2009-01-02 15:49:31 UTC (rev 18265)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt	2009-01-02 16:58:09 UTC (rev 18266)
@@ -50,16 +50,20 @@
      rna_modifier.c
      rna_nodetree.c
      rna_object.c
+     rna_object_force.c
      rna_packedfile.c
+     rna_particle.c
      rna_property.c
      rna_radio.c
      rna_rna.c
      rna_scene.c
      rna_screen.c
+     rna_scriptlink.c
      rna_sensor.c
      rna_sequence.c
      rna_sound.c
      rna_text.c
+     rna_userdef.c
      rna_vfont.c
      rna_wm.c
      rna_world.c

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2009-01-02 15:49:31 UTC (rev 18265)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2009-01-02 16:58:09 UTC (rev 18266)
@@ -283,7 +283,7 @@
 {
 	char *func;
 
-	if(prop->flag & PROP_IDPROPERTY)
+	if(prop->flag & (PROP_IDPROPERTY|PROP_NOT_EDITABLE))
 		return NULL;
 
 	if(!dp->dnastructname || !dp->dnaname) {
@@ -928,6 +928,7 @@
 	{"rna_rna.c", RNA_def_rna},
 	{"rna_scene.c", RNA_def_scene},
 	{"rna_screen.c", RNA_def_screen},
+	{"rna_scriptlink.c", RNA_def_scriptlink},
 	{"rna_sensor.c", RNA_def_sensor},
 	{"rna_sequence.c", RNA_def_sequence},
 	{"rna_text.c", RNA_def_text},

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h	2009-01-02 15:49:31 UTC (rev 18265)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h	2009-01-02 16:58:09 UTC (rev 18266)
@@ -125,6 +125,7 @@
 void RNA_def_rna(struct BlenderRNA *brna);
 void RNA_def_scene(struct BlenderRNA *brna);
 void RNA_def_screen(struct BlenderRNA *brna);
+void RNA_def_scriptlink(struct BlenderRNA *brna);
 void RNA_def_sensor(struct BlenderRNA *brna);
 void RNA_def_sequence(struct BlenderRNA *brna);
 void RNA_def_text(struct BlenderRNA *brna);

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c	2009-01-02 15:49:31 UTC (rev 18265)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c	2009-01-02 16:58:09 UTC (rev 18266)
@@ -65,6 +65,22 @@
 	*max= ob->totcol-1;
 }
 
+static int rna_Object_active_material_link_get(PointerRNA *ptr)
+{
+	Object *ob= (Object*)ptr->id.data;
+	return (ob->colbits & 1<<(ob->actcol)) != 0;
+}
+
+static void rna_Object_active_material_link_set(PointerRNA *ptr, int value)
+{
+	Object *ob= (Object*)ptr->id.data;
+	
+	if(value)
+		ob->colbits |= (1<<(ob->actcol));
+	else
+		ob->colbits &= ~(1<<(ob->actcol));
+}
+
 static void *rna_Object_game_settings_get(PointerRNA *ptr)
 {
 	return ptr->id.data;
@@ -142,6 +158,8 @@
 	RNA_def_struct_sdna(srna, "Object");
 	RNA_def_struct_ui_text(srna, "Object Game Settings", "Game engine related settings for the object.");
 
+	/* logic */
+
 	prop= RNA_def_property(srna, "sensors", PROP_COLLECTION, PROP_NONE);
 	RNA_def_property_struct_type(prop, "Sensor");
 	RNA_def_property_ui_text(prop, "Sensors", "DOC_BROKEN");
@@ -159,6 +177,20 @@
 	RNA_def_property_struct_type(prop, "GameProperty");
 	RNA_def_property_ui_text(prop, "Properties", "Game engine properties.");
 
+	prop= RNA_def_property(srna, "show_sensors", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWSENS);
+	RNA_def_property_ui_text(prop, "Show Sensors", "Shows sensors for this object in the user interface.");
+
+	prop= RNA_def_property(srna, "show_controllers", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWCONT);
+	RNA_def_property_ui_text(prop, "Show Controllers", "Shows controllers for this object in the user interface.");
+
+	prop= RNA_def_property(srna, "show_actuators", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_SHOWACT);
+	RNA_def_property_ui_text(prop, "Show Actuators", "Shows actuators for this object in the user interface.");
+
+	/* physics */
+
 	prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "body_type");
 	RNA_def_property_enum_items(prop, body_type_items);
@@ -236,6 +268,12 @@
 	RNA_def_property_range(prop, 0.0, 1.0);
 	RNA_def_property_ui_text(prop, "Collision Margin", "Extra margin around object for collision detection, small amount required for stability.");
 
+	prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
+	RNA_def_property_pointer_sdna(prop, NULL, "bsoft");
+	RNA_def_property_ui_text(prop, "Soft Body Settings", "Settings for Bullet soft body simulation.");
+
+	/* state */
+
 	prop= RNA_def_property(srna, "state", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "state", 1);
 	RNA_def_property_array(prop, 30);
@@ -247,9 +285,9 @@
 	RNA_def_property_array(prop, 30);
 	RNA_def_property_ui_text(prop, "Initial State", "Initial state when the game starts.");
 
-	prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE);
-	RNA_def_property_pointer_sdna(prop, NULL, "bsoft");
-	RNA_def_property_ui_text(prop, "Soft Body Settings", "Settings for Bullet soft body simulation.");
+	prop= RNA_def_property(srna, "debug_state", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "scaflag", OB_DEBUGSTATE);
+	RNA_def_property_ui_text(prop, "Debug State", "Print state debug info in the game engine.");
 }
 
 static void rna_def_object(BlenderRNA *brna)
@@ -277,8 +315,43 @@
 		{OB_EMPTY_SPHERE, "SPHERE", "Sphere", ""},
 		{OB_EMPTY_CONE, "CONE", "Cone", ""},
 		{0, NULL, NULL, NULL}};
+	
+	static EnumPropertyItem track_items[] = {
+		{OB_POSX, "POSX", "+X", ""},
+		{OB_POSY, "POSY", "+Y", ""},
+		{OB_POSZ, "POSZ", "+Z", ""},
+		{OB_NEGX, "NEGX", "-X", ""},
+		{OB_NEGY, "NEGY", "-Y", ""},
+		{OB_NEGZ, "NEGZ", "-Z", ""},
+		{0, NULL, NULL, NULL}};
 
+	static EnumPropertyItem up_items[] = {
+		{OB_POSX, "X", "X", ""},
+		{OB_POSY, "Y", "Y", ""},
+		{OB_POSZ, "Z", "Z", ""},
+		{0, NULL, NULL, NULL}};
 
+	static EnumPropertyItem drawtype_items[] = {
+		{OB_BOUNDBOX, "BOUNDS", "Bounds", ""},
+		{OB_WIRE, "WIRE", "Wire", ""},
+		{OB_SOLID, "SOLID", "Solid", ""},
+		{OB_SHADED, "SHADED", "Shaded", ""},
+		{OB_TEXTURE, "TEXTURED", "Textured", ""},
+		{0, NULL, NULL, NULL}};
+
+	static EnumPropertyItem boundtype_items[] = {
+		{OB_BOUND_BOX, "BOX", "Box", ""},
+		{OB_BOUND_SPHERE, "SPHERE", "Sphere", ""},
+		{OB_BOUND_CYLINDER, "CYLINDER", "Cylinder", ""},
+		{OB_BOUND_CONE, "CONE", "Cone", ""},
+		{OB_BOUND_POLYH, "POLYHEDER", "Polyheder", ""},
+		{0, NULL, NULL, NULL}};
+
+	static EnumPropertyItem material_link_items[] = {
+		{0, "DATA", "Data", ""},
+		{1, "OBJECT", "Object", ""},
+		{0, NULL, NULL, NULL}};
+
 	srna= RNA_def_struct(brna, "Object", "ID");
 	RNA_def_struct_ui_text(srna, "Object", "DOC_BROKEN");
 
@@ -292,6 +365,10 @@
 	RNA_def_property_ui_text(prop, "Layers", "Layers the object is on.");
 	RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_layer_set");
 
+	prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
+	RNA_def_property_ui_text(prop, "Selected", "Object selection state.");
+
 	/* parent and track */
 
 	prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
@@ -316,6 +393,16 @@
 	prop= RNA_def_property(srna, "track", PROP_POINTER, PROP_NONE);
 	RNA_def_property_ui_text(prop, "Track", "Object being tracked to define the rotation (Old Track).");
 
+	prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "trackflag");
+	RNA_def_property_enum_items(prop, track_items);
+	RNA_def_property_ui_text(prop, "Track Axis", "Tracking axis pointing to the another object.");
+
+	prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "upflag");
+	RNA_def_property_enum_items(prop, up_items);
+	RNA_def_property_ui_text(prop, "Up Axis", "Specify the axis that points up.");
+
 	/* proxy */
 
 	prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
@@ -324,22 +411,6 @@
 	prop= RNA_def_property(srna, "proxy_group", PROP_POINTER, PROP_NONE);
 	RNA_def_property_ui_text(prop, "Proxy Group", "Library group duplicator object this proxy object controls.");
 
-	/* action / pose */
-
-	prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE);
-	RNA_def_property_struct_type(prop, "UnknownType");
-	RNA_def_property_ui_text(prop, "Action", "Action used by object to define Ipo curves.");
-
-	prop= RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE);
-	RNA_def_property_pointer_sdna(prop, NULL, "poselib");
-	RNA_def_property_struct_type(prop, "UnknownType");

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list