Revision: 19418
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19418
Author:   blendix
Date:     2009-03-26 14:56:32 +0100 (Thu, 26 Mar 2009)

Log Message:
-----------
RNA: particle wrapping is a bit more complete now.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_particle.c

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c     
2009-03-26 11:12:39 UTC (rev 19417)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c     
2009-03-26 13:56:32 UTC (rev 19418)
@@ -113,6 +113,7 @@
        
        while(1) {
                if(name[a]=='[' && oname[a]==0) return 1;
+               if(name[a]=='[' && oname[a]=='[') return 1;
                if(name[a]==0) break;
                if(name[a] != oname[a]) return 0;
                a++;
@@ -145,8 +146,12 @@
                if(cmp == 1) {
                        smember->type= sdna->types[sp[0]];
                        smember->name= dnaname;
-                       smember->arraylength= 
DNA_elem_array_size(smember->name, strlen(smember->name));
 
+                       if(strstr(membername, "["))
+                               smember->arraylength= 0;
+                       else
+                               smember->arraylength= 
DNA_elem_array_size(smember->name, strlen(smember->name));
+
                        smember->pointerlevel= 0;
                        for(b=0; dnaname[b] == '*'; b++)
                                smember->pointerlevel++;

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_particle.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_particle.c   
2009-03-26 11:12:39 UTC (rev 19417)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_particle.c   
2009-03-26 13:56:32 UTC (rev 19418)
@@ -32,6 +32,7 @@
 #include "rna_internal.h"
 
 #include "DNA_particle_types.h"
+#include "DNA_object_force.h"
 
 #ifdef RNA_RUNTIME
 
@@ -87,30 +88,24 @@
 }
 #else
 
-static void rna_def_hair_key(BlenderRNA *brna)
+static void rna_def_particle_hair_key(BlenderRNA *brna)
 {
        StructRNA *srna;
        PropertyRNA *prop;
 
-       srna = RNA_def_struct(brna, "HairKey", NULL);
-       RNA_def_struct_ui_text(srna, "Hair Key", "DOC_BROKEN");
+       srna = RNA_def_struct(brna, "ParticleHairKey", NULL);
+       RNA_def_struct_sdna(srna, "HairKey");
+       RNA_def_struct_ui_text(srna, "Particle Hair Key", "Particle key for 
hair particle system.");
 
-       prop= RNA_def_property(srna, "hair_vertex_location", PROP_FLOAT, 
PROP_VECTOR);
+       prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
        RNA_def_property_float_sdna(prop, NULL, "co");
-       RNA_def_property_array(prop, 3);
-       //TODO:bounds
-       RNA_def_property_ui_text(prop, "Hair Vertex Location", "");
+       RNA_def_property_ui_text(prop, "Location", "Key location.");
 
-       prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_NONE);
-//     RNA_def_property_range(prop, lowerLimitf, upperLimitf);
-       RNA_def_property_ui_text(prop, "Time", "Time along hair");
+       prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
+       RNA_def_property_ui_text(prop, "Time", "Relative time of key over hair 
length.");
 
-       prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
-//     RNA_def_property_range(prop, lowerLimitf, upperLimitf);
-       RNA_def_property_ui_text(prop, "Softbody Weight", "");
-
-//     short editflag; /* saved particled edit mode flags */
-
+       prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_UNSIGNED);
+       RNA_def_property_ui_text(prop, "Weight", "Weight for softbody 
simulation.");
 }
 
 static void rna_def_particle_key(BlenderRNA *brna)
@@ -119,36 +114,26 @@
        PropertyRNA *prop;
 
        srna = RNA_def_struct(brna, "ParticleKey", NULL);
-       RNA_def_struct_ui_text(srna, "Particle Key", "DOC_BROKEN");
+       RNA_def_struct_ui_text(srna, "Particle Key", "Key location for a 
particle over time.");
 
        prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_VECTOR);
        RNA_def_property_float_sdna(prop, NULL, "co");
-       RNA_def_property_array(prop, 3);
-       //TODO:bounds
-       RNA_def_property_ui_text(prop, "Location", "");
+       RNA_def_property_ui_text(prop, "Location", "Key location.");
 
        prop= RNA_def_property(srna, "velocity", PROP_FLOAT, PROP_VECTOR);
        RNA_def_property_float_sdna(prop, NULL, "vel");
-       RNA_def_property_array(prop, 3);
-       //TODO:bounds
-       RNA_def_property_ui_text(prop, "Velocity", "");
+       RNA_def_property_ui_text(prop, "Velocity", "Key velocity");
 
-       prop= RNA_def_property(srna, "rotation_quaternion", PROP_FLOAT, 
PROP_VECTOR);
+       prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_ROTATION);
        RNA_def_property_float_sdna(prop, NULL, "rot");
-       RNA_def_property_array(prop, 4);
-       //TODO:bounds
-       RNA_def_property_ui_text(prop, "Rotation Quaternion", "");
+       RNA_def_property_ui_text(prop, "Rotation", "Key rotation quaterion.");
 
-       prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, 
PROP_VECTOR);
+       prop= RNA_def_property(srna, "angular_velocity", PROP_FLOAT, 
PROP_ROTATION);
        RNA_def_property_float_sdna(prop, NULL, "ave");
-       RNA_def_property_array(prop, 3);
-       //TODO:bounds
-       RNA_def_property_ui_text(prop, "Angular Velocity", "");
+       RNA_def_property_ui_text(prop, "Angular Velocity", "Key angular 
velocity.");
 
-       prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_float_sdna(prop, NULL, "time");//optional if prop 
names are the same
-//     RNA_def_property_range(prop, lowerLimitf, upperLimitf);
-       RNA_def_property_ui_text(prop, "Time", "Time along hair");
+       prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_UNSIGNED);
+       RNA_def_property_ui_text(prop, "Time", "Time of key over the 
simulation.");
 }
 
 static void rna_def_child_particle(BlenderRNA *brna)
@@ -157,7 +142,7 @@
        //PropertyRNA *prop;
 
        srna = RNA_def_struct(brna, "ChildParticle", NULL);
-       RNA_def_struct_ui_text(srna, "Child Particle", "DOC_BROKEN");
+       RNA_def_struct_ui_text(srna, "Child Particle", "Child particle 
interpolated from simulated or edited particles.");
 
 //     int num, parent;        /* num is face index on the final derived mesh 
*/
 
@@ -167,7 +152,7 @@
 //     float rand[3];
 }
 
-static void rna_def_particle_data(BlenderRNA *brna)
+static void rna_def_particle(BlenderRNA *brna)
 {
        StructRNA *srna;
        PropertyRNA *prop;
@@ -306,7 +291,7 @@
 //     short rt2;
 }
 
-static void rna_def_particlesettings(BlenderRNA *brna)
+static void rna_def_particle_settings(BlenderRNA *brna)
 {
        StructRNA *srna;
        PropertyRNA *prop;
@@ -1183,7 +1168,7 @@
 //     struct PartDeflect *pd2;
 }
 
-static void rna_def_particlesystem(BlenderRNA *brna)
+static void rna_def_particle_system(BlenderRNA *brna)
 {
        StructRNA *srna;
        PropertyRNA *prop;
@@ -1205,10 +1190,24 @@
        RNA_def_property_struct_type(prop, "ChildParticle");
        RNA_def_property_ui_text(prop, "Child Particles", "Child particles 
generated by the particle system.");
 
+       prop= RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
+       RNA_def_property_ui_text(prop, "Seed", "Offset in the random number 
table, to get a different randomized result.");
+
+       /* hair */
        prop= RNA_def_property(srna, "softbody", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "soft");
        RNA_def_property_ui_text(prop, "Soft Body", "Soft body settings for 
hair physics simulation.");
 
+       prop= RNA_def_property(srna, "use_softbody", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_ENABLE);
+       RNA_def_property_ui_text(prop, "Use Soft Body", "Enable use of soft 
body for hair physics simulation.");
+
+       prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_EDITED);
+       RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* various checks 
needed */
+       RNA_def_property_ui_text(prop, "Editable", "For hair particle systems, 
finalize the hair to enable editing.");
+
+       /* reactor */
        prop= RNA_def_property(srna, "reactor_target_object", PROP_POINTER, 
PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "target_ob");
        RNA_def_property_ui_text(prop, "Reactor Target Object", "For reactor 
systems, the object that has the target particle system (empty if same 
object).");
@@ -1218,10 +1217,12 @@
        RNA_def_property_range(prop, 1, INT_MAX);
        RNA_def_property_ui_text(prop, "Reactor Target Particle System", "For 
reactor systems, index of particle system on the target object.");
 
+       /* boids */
        prop= RNA_def_property(srna, "boids_surface_object", PROP_POINTER, 
PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "keyed_ob");
        RNA_def_property_ui_text(prop, "Boids Surface Object", "For boids 
physics systems, constrain boids to this object's surface.");
 
+       /* keyed */
        prop= RNA_def_property(srna, "keyed_object", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "keyed_ob");
        RNA_def_property_ui_text(prop, "Keyed Object", "For keyed physics 
systems, the object that has the target particle system.");
@@ -1231,18 +1232,129 @@
        RNA_def_property_range(prop, 1, INT_MAX);
        RNA_def_property_ui_text(prop, "Keyed Particle System", "For keyed 
physics systems, index of particle system on the keyed object.");
 
-       prop= RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
-       RNA_def_property_ui_text(prop, "Seed", "Offset in the random number 
table, to get a different randomized result.");
+       prop= RNA_def_property(srna, "keyed_first", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_FIRST_KEYED);
+       RNA_def_property_ui_text(prop, "Keyed First", "Set the system to be the 
starting point of keyed particles");
 
-       //      int seed;
-       //      int flag, rt;
-       //      short recalc, totkeyed, softflag, bakespace;
-       //
-       //      char bb_uvname[3][32];                                  /* 
billboard uv name */
-       //
-       //      /* if you change these remember to update array lengths to 
PSYS_TOT_VG! */
-       //      short vgroup[12], vg_neg, rt3;                  /* vertex 
groups */
+       prop= RNA_def_property(srna, "keyed_timed", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_KEYED_TIME);
+       RNA_def_property_ui_text(prop, "Keyed Timed", "Use intermediate key 
times for keyed particles (setting for starting point only).");
 
+
+       /* billboard */
+       prop= RNA_def_property(srna, "billboard_normal_uv", PROP_STRING, 
PROP_NONE);
+       RNA_def_property_string_sdna(prop, NULL, "bb_uvname[0]");
+       RNA_def_property_string_maxlength(prop, 32);
+       RNA_def_property_ui_text(prop, "Billboard Normal UV", "UV Layer to 
control billboard normals.");
+
+       prop= RNA_def_property(srna, "billboard_time_index_uv", PROP_STRING, 
PROP_NONE);
+       RNA_def_property_string_sdna(prop, NULL, "bb_uvname[1]");
+       RNA_def_property_string_maxlength(prop, 32);
+       RNA_def_property_ui_text(prop, "Billboard Time Index UV", "UV Layer to 
control billboard time index (X-Y).");
+
+       prop= RNA_def_property(srna, "billboard_split_uv", PROP_STRING, 
PROP_NONE);
+       RNA_def_property_string_sdna(prop, NULL, "bb_uvname[2]");

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to