[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31544] trunk/blender: move more active variables to be nested in collections.
Campbell Barton
ideasman42 at gmail.com
Tue Aug 24 06:03:02 CEST 2010
Revision: 31544
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31544
Author: campbellbarton
Date: 2010-08-24 06:02:50 +0200 (Tue, 24 Aug 2010)
Log Message:
-----------
move more active variables to be nested in collections.
Modified Paths:
--------------
trunk/blender/release/scripts/ui/properties_data_armature.py
trunk/blender/release/scripts/ui/properties_data_mesh.py
trunk/blender/release/scripts/ui/properties_particle.py
trunk/blender/release/scripts/ui/properties_physics_common.py
trunk/blender/release/scripts/ui/properties_render.py
trunk/blender/release/scripts/ui/properties_scene.py
trunk/blender/release/scripts/ui/space_view3d.py
trunk/blender/release/scripts/ui/space_view3d_toolbar.py
trunk/blender/source/blender/makesrna/intern/rna_animation.c
trunk/blender/source/blender/makesrna/intern/rna_mesh.c
trunk/blender/source/blender/makesrna/intern/rna_object.c
trunk/blender/source/blender/makesrna/intern/rna_object_force.c
trunk/blender/source/blender/makesrna/intern/rna_pose.c
trunk/blender/source/blender/makesrna/intern/rna_scene.c
Modified: trunk/blender/release/scripts/ui/properties_data_armature.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_armature.py 2010-08-24 03:02:27 UTC (rev 31543)
+++ trunk/blender/release/scripts/ui/properties_data_armature.py 2010-08-24 04:02:50 UTC (rev 31544)
@@ -119,7 +119,7 @@
pose = ob.pose
row = layout.row()
- row.template_list(pose, "bone_groups", pose, "active_bone_group_index", rows=2)
+ row.template_list(pose, "bone_groups", pose.bone_groups, "active_index", rows=2)
col = row.column(align=True)
col.active = (ob.proxy is None)
Modified: trunk/blender/release/scripts/ui/properties_data_mesh.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_mesh.py 2010-08-24 03:02:27 UTC (rev 31543)
+++ trunk/blender/release/scripts/ui/properties_data_mesh.py 2010-08-24 04:02:50 UTC (rev 31544)
@@ -127,14 +127,14 @@
layout = self.layout
ob = context.object
- group = ob.active_vertex_group
+ group = ob.vertex_groups.active
rows = 2
if group:
rows = 5
row = layout.row()
- row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index", rows=rows)
+ row.template_list(ob, "vertex_groups", ob.vertex_groups, "active_index", rows=rows)
col = row.column(align=True)
col.operator("object.vertex_group_add", icon='ZOOMIN', text="")
@@ -266,7 +266,7 @@
row = layout.row()
col = row.column()
- col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
+ col.template_list(me, "uv_textures", me.uv_textures, "active_index", rows=2)
col = row.column(align=True)
col.operator("mesh.uv_texture_add", icon='ZOOMIN', text="")
@@ -335,7 +335,7 @@
row = layout.row()
col = row.column()
- col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
+ col.template_list(me, "vertex_colors", me.vertex_colors, "active_index", rows=2)
col = row.column(align=True)
col.operator("mesh.vertex_color_add", icon='ZOOMIN', text="")
Modified: trunk/blender/release/scripts/ui/properties_particle.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_particle.py 2010-08-24 03:02:27 UTC (rev 31543)
+++ trunk/blender/release/scripts/ui/properties_particle.py 2010-08-24 04:02:50 UTC (rev 31544)
@@ -69,7 +69,7 @@
if ob:
row = layout.row()
- row.template_list(ob, "particle_systems", ob, "active_particle_system_index", rows=2)
+ row.template_list(ob, "particle_systems", ob.particle_systems, "active_index", rows=2)
col = row.column(align=True)
col.operator("object.particle_system_add", icon='ZOOMIN', text="")
Modified: trunk/blender/release/scripts/ui/properties_physics_common.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_physics_common.py 2010-08-24 03:02:27 UTC (rev 31543)
+++ trunk/blender/release/scripts/ui/properties_physics_common.py 2010-08-24 04:02:50 UTC (rev 31544)
@@ -29,7 +29,7 @@
layout.set_context_pointer("point_cache", cache)
row = layout.row()
- row.template_list(cache, "point_caches", cache, "active_point_cache_index", rows=2)
+ row.template_list(cache, "point_caches", cache.point_caches, "active_index", rows=2)
col = row.column(align=True)
col.operator("ptcache.add", icon='ZOOMIN', text="")
col.operator("ptcache.remove", icon='ZOOMOUT', text="")
Modified: trunk/blender/release/scripts/ui/properties_render.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_render.py 2010-08-24 03:02:27 UTC (rev 31543)
+++ trunk/blender/release/scripts/ui/properties_render.py 2010-08-24 04:02:50 UTC (rev 31544)
@@ -78,7 +78,7 @@
rd = scene.render
row = layout.row()
- row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
+ row.template_list(rd, "layers", rd.layers, "active_index", rows=2)
col = row.column(align=True)
col.operator("scene.render_layer_add", icon='ZOOMIN', text="")
Modified: trunk/blender/release/scripts/ui/properties_scene.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_scene.py 2010-08-24 03:02:27 UTC (rev 31543)
+++ trunk/blender/release/scripts/ui/properties_scene.py 2010-08-24 04:02:50 UTC (rev 31544)
@@ -76,7 +76,7 @@
row = layout.row()
col = row.column()
- col.template_list(scene, "keying_sets", scene, "active_keying_set_index", rows=2)
+ col.template_list(scene, "keying_sets", scene.keying_sets, "active_index", rows=2)
col = row.column(align=True)
col.operator("anim.keying_set_add", icon='ZOOMIN', text="")
@@ -121,7 +121,7 @@
row = layout.row()
col = row.column()
- col.template_list(ks, "paths", ks, "active_path_index", rows=2)
+ col.template_list(ks, "paths", ks.paths, "active_index", rows=2)
col = row.column(align=True)
col.operator("anim.keying_set_path_add", icon='ZOOMIN', text="")
Modified: trunk/blender/release/scripts/ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d.py 2010-08-24 03:02:27 UTC (rev 31543)
+++ trunk/blender/release/scripts/ui/space_view3d.py 2010-08-24 04:02:50 UTC (rev 31544)
@@ -966,14 +966,14 @@
ob = context.active_object
if ob.mode == 'EDIT':
- if ob.vertex_groups and ob.active_vertex_group:
+ if ob.vertex_groups.active:
layout.separator()
layout.operator("object.vertex_group_assign", text="Assign to Active Group")
layout.operator("object.vertex_group_remove_from", text="Remove from Active Group")
layout.operator("object.vertex_group_remove_from", text="Remove from All").all = True
layout.separator()
- if ob.vertex_groups and ob.active_vertex_group:
+ if ob.vertex_groups.active:
layout.operator_menu_enum("object.vertex_group_set_active", "group", text="Set Active Group")
layout.operator("object.vertex_group_remove", text="Remove Active Group")
layout.operator("object.vertex_group_remove", text="Remove All Groups").all = True
Modified: trunk/blender/release/scripts/ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d_toolbar.py 2010-08-24 03:02:27 UTC (rev 31543)
+++ trunk/blender/release/scripts/ui/space_view3d_toolbar.py 2010-08-24 04:02:50 UTC (rev 31544)
@@ -1300,16 +1300,16 @@
if pe.type == 'PARTICLES':
if ob.particle_systems:
if len(ob.particle_systems) > 1:
- layout.template_list(ob, "particle_systems", ob, "active_particle_system_index", type='ICONS')
+ layout.template_list(ob, "particle_systems", ob.particle_systems, "active_index", type='ICONS')
- ptcache = ob.particle_systems[ob.active_particle_system_index].point_cache
+ ptcache = ob.particle_systems.active.point_cache
else:
for md in ob.modifiers:
if md.type == pe.type:
ptcache = md.point_cache
if ptcache and len(ptcache.point_caches) > 1:
- layout.template_list(ptcache, "point_caches", ptcache, "active_point_cache_index", type='ICONS')
+ layout.template_list(ptcache, "point_caches", ptcache.point_caches, "active_index", type='ICONS')
if not pe.is_editable:
Modified: trunk/blender/source/blender/makesrna/intern/rna_animation.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_animation.c 2010-08-24 03:02:27 UTC (rev 31543)
+++ trunk/blender/source/blender/makesrna/intern/rna_animation.c 2010-08-24 04:02:50 UTC (rev 31544)
@@ -528,7 +528,6 @@
}
-
/* keyingset.paths */
static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop)
{
@@ -585,6 +584,11 @@
RNA_def_property_editable_func(prop, "rna_KeyingSet_active_ksPath_editable");
RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_active_ksPath_get", "rna_KeyingSet_active_ksPath_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes");
+
+ prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "active_path");
+ RNA_def_property_int_funcs(prop, "rna_KeyingSet_active_ksPath_index_get", "rna_KeyingSet_active_ksPath_index_set", "rna_KeyingSet_active_ksPath_index_range");
+ RNA_def_property_ui_text(prop, "Active Path Index", "Current Keying Set index");
}
static void rna_def_keyingset(BlenderRNA *brna)
@@ -613,13 +617,7 @@
RNA_def_property_struct_type(prop, "KeyingSetPath");
RNA_def_property_ui_text(prop, "Paths", "Keying Set Paths to define settings that get keyframed together");
rna_def_keyingset_paths(brna, prop);
-
- /* TODO, move to collection */
- prop= RNA_def_property(srna, "active_path_index", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "active_path");
- RNA_def_property_int_funcs(prop, "rna_KeyingSet_active_ksPath_index_get", "rna_KeyingSet_active_ksPath_index_set", "rna_KeyingSet_active_ksPath_index_range");
- RNA_def_property_ui_text(prop, "Active Path Index", "Current Keying Set index");
-
+
/* Flags */
prop= RNA_def_property(srna, "is_path_absolute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
Modified: trunk/blender/source/blender/makesrna/intern/rna_mesh.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_mesh.c 2010-08-24 03:02:27 UTC (rev 31543)
+++ trunk/blender/source/blender/makesrna/intern/rna_mesh.c 2010-08-24 04:02:50 UTC (rev 31544)
@@ -1690,6 +1690,11 @@
RNA_def_property_flag(prop, PROP_EDITABLE);
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list