Changed hand-generated RNA paths to quote strings used as collection indexes.
authorMatt Ebb <matt@mke3.net>
Tue, 3 Nov 2009 22:07:15 +0000 (22:07 +0000)
committerMatt Ebb <matt@mke3.net>
Tue, 3 Nov 2009 22:07:15 +0000 (22:07 +0000)
Previous method worked fine for Blender animation system, but this is more convenient for Python.

source/blender/makesrna/intern/rna_boid.c
source/blender/makesrna/intern/rna_cloth.c
source/blender/makesrna/intern/rna_fluidsim.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_smoke.c

index 36a648c8a82f061452e6d01a8f98c83d31086454..37b957a16caef2ea9144708be34ceec3d515d566 100644 (file)
@@ -129,7 +129,7 @@ static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr)
 
 static char *rna_BoidRule_path(PointerRNA *ptr)
 {
-       return BLI_sprintfN("rules[%s]", ((BoidRule*)ptr->data)->name);  // XXX not unique
+       return BLI_sprintfN("rules[\"%s\"]", ((BoidRule*)ptr->data)->name);  // XXX not unique
 }
 
 static PointerRNA rna_BoidState_active_boid_rule_get(PointerRNA *ptr)
index d64e2c7119b31fb65f1d020f517555849b5eb6fb..d78544634bcfb127300439160644702de4f47622 100644 (file)
@@ -152,7 +152,7 @@ static char *rna_ClothSettings_path(PointerRNA *ptr)
        Object *ob= (Object*)ptr->id.data;
        ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth);
 
-       return md ? BLI_sprintfN("modifiers[%s].settings", md->name) : NULL;
+       return md ? BLI_sprintfN("modifiers[\"%s\"].settings", md->name) : NULL;
 }
 
 static char *rna_ClothCollisionSettings_path(PointerRNA *ptr)
@@ -160,7 +160,7 @@ static char *rna_ClothCollisionSettings_path(PointerRNA *ptr)
        Object *ob= (Object*)ptr->id.data;
        ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth);
 
-       return md ? BLI_sprintfN("modifiers[%s].collision_settings", md->name) : NULL;
+       return md ? BLI_sprintfN("modifiers[\"%s\"].collision_settings", md->name) : NULL;
 }
 
 #else
index ae52c811c92c1347a61273f1889806e064d5219d..2517ee5c8ef6a0cb7763d1ee8dc1185888eb0904 100644 (file)
@@ -157,7 +157,7 @@ static char *rna_FluidSettings_path(PointerRNA *ptr)
        FluidsimSettings *fss = (FluidsimSettings*)ptr->data;
        ModifierData *md= (ModifierData *)fss->fmd;
 
-       return BLI_sprintfN("modifiers[%s].settings", md->name);
+       return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
 }
 
 #else
index 2f14ab0c98cb08fae8b48c24405b68f01d8a05f7..ab745394ce5adf87f1528ee05066f31dff62d5d5 100644 (file)
@@ -798,7 +798,7 @@ static char *rna_MeshVertex_path(PointerRNA *ptr)
 
 static char *rna_MeshTextureFaceLayer_path(PointerRNA *ptr)
 {
-       return BLI_sprintfN("uv_textures[%s]", ((CustomDataLayer*)ptr->data)->name);
+       return BLI_sprintfN("uv_textures[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
 }
 
 static char *rna_CustomDataData_path(PointerRNA *ptr, char *collection, int type)
@@ -813,7 +813,7 @@ static char *rna_CustomDataData_path(PointerRNA *ptr, char *collection, int type
                if(cdl->type == type) {
                        b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type);
                        if(b >= 0 && b < me->totface)
-                               return BLI_sprintfN("%s[%s].data[%d]", collection, cdl->name, b);
+                               return BLI_sprintfN("%s[\"%s\"].data[%d]", collection, cdl->name, b);
                }
        }
 
@@ -827,7 +827,7 @@ static char *rna_MeshTextureFace_path(PointerRNA *ptr)
 
 static char *rna_MeshColorLayer_path(PointerRNA *ptr)
 {
-       return BLI_sprintfN("vertex_colors[%s]", ((CustomDataLayer*)ptr->data)->name);
+       return BLI_sprintfN("vertex_colors[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
 }
 
 static char *rna_MeshColor_path(PointerRNA *ptr)
@@ -842,7 +842,7 @@ static char *rna_MeshSticky_path(PointerRNA *ptr)
 
 static char *rna_MeshIntPropertyLayer_path(PointerRNA *ptr)
 {
-       return BLI_sprintfN("int_layers[%s]", ((CustomDataLayer*)ptr->data)->name);
+       return BLI_sprintfN("int_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
 }
 
 static char *rna_MeshIntProperty_path(PointerRNA *ptr)
@@ -852,7 +852,7 @@ static char *rna_MeshIntProperty_path(PointerRNA *ptr)
 
 static char *rna_MeshFloatPropertyLayer_path(PointerRNA *ptr)
 {
-       return BLI_sprintfN("float_layers[%s]", ((CustomDataLayer*)ptr->data)->name);
+       return BLI_sprintfN("float_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
 }
 
 static char *rna_MeshFloatProperty_path(PointerRNA *ptr)
@@ -862,7 +862,7 @@ static char *rna_MeshFloatProperty_path(PointerRNA *ptr)
 
 static char *rna_MeshStringPropertyLayer_path(PointerRNA *ptr)
 {
-       return BLI_sprintfN("string_layers[%s]", ((CustomDataLayer*)ptr->data)->name);
+       return BLI_sprintfN("string_layers[\"%s\"]", ((CustomDataLayer*)ptr->data)->name);
 }
 
 static char *rna_MeshStringProperty_path(PointerRNA *ptr)
index 36a370e8561d1e0f0f0cd8a378e84632593e0489..9ecea76ab0d6f1a1a448e0e7752f09eaee26528a 100644 (file)
@@ -300,7 +300,7 @@ static char *rna_CollisionSettings_path(PointerRNA *ptr)
        Object *ob= (Object*)ptr->id.data;
        ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Collision);
        
-       return BLI_sprintfN("modifiers[%s].settings", md->name);
+       return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
 }
 
 static int rna_SoftBodySettings_use_edges_get(PointerRNA *ptr)
@@ -417,7 +417,7 @@ static char *rna_SoftBodySettings_path(PointerRNA *ptr)
        Object *ob= (Object*)ptr->id.data;
        ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Softbody);
        
-       return BLI_sprintfN("modifiers[%s].settings", md->name);
+       return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
 }
 
 static int particle_id_check(PointerRNA *ptr)
@@ -575,7 +575,7 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
                if (md) {
                        /* no pointer from modifier data to actual softbody storage, would be good to add */
                        if (ob->soft->effector_weights == ew)
-                               return BLI_sprintfN("modifiers[%s].settings.effector_weights", md->name);
+                               return BLI_sprintfN("modifiers[\"%s\"].settings.effector_weights", md->name);
                }
                
                /* check cloth modifier */
@@ -584,7 +584,7 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
                        ClothModifierData *cmd = (ClothModifierData *)md;
                        
                        if (cmd->sim_parms->effector_weights == ew)
-                               return BLI_sprintfN("modifiers[%s].settings.effector_weights", md->name);
+                               return BLI_sprintfN("modifiers[\"%s\"].settings.effector_weights", md->name);
                }
                
                /* check smoke modifier */
@@ -593,7 +593,7 @@ static char *rna_EffectorWeight_path(PointerRNA *ptr)
                        SmokeModifierData *smd = (SmokeModifierData *)md;
                        
                        if (smd->domain->effector_weights == ew)
-                               return BLI_sprintfN("modifiers[%s].settings.effector_weights", md->name);
+                               return BLI_sprintfN("modifiers[\"%s\"].settings.effector_weights", md->name);
                }
        }
        return NULL;
index c8193bb4005dbfc4ea998ec6382794c1596130b5..e302ea90a8a3ef625a03f30ecb63879d0cf519bc 100644 (file)
@@ -83,7 +83,7 @@ static char *rna_SmokeDomainSettings_path(PointerRNA *ptr)
        SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data;
        ModifierData *md= (ModifierData *)settings->smd;
 
-       return BLI_sprintfN("modifiers[%s].domain_settings", md->name);
+       return BLI_sprintfN("modifiers[\"%s\"].domain_settings", md->name);
 }
 
 static char *rna_SmokeFlowSettings_path(PointerRNA *ptr)
@@ -91,7 +91,7 @@ static char *rna_SmokeFlowSettings_path(PointerRNA *ptr)
        SmokeFlowSettings *settings = (SmokeFlowSettings*)ptr->data;
        ModifierData *md= (ModifierData *)settings->smd;
 
-       return BLI_sprintfN("modifiers[%s].flow_settings", md->name);
+       return BLI_sprintfN("modifiers[\"%s\"].flow_settings", md->name);
 }
 
 static char *rna_SmokeCollSettings_path(PointerRNA *ptr)
@@ -99,7 +99,7 @@ static char *rna_SmokeCollSettings_path(PointerRNA *ptr)
        SmokeCollSettings *settings = (SmokeCollSettings*)ptr->data;
        ModifierData *md= (ModifierData *)settings->smd;
 
-       return BLI_sprintfN("modifiers[%s].coll_settings", md->name);
+       return BLI_sprintfN("modifiers[\"%s\"].coll_settings", md->name);
 }
 
 #else