diff options
-rw-r--r-- | release/scripts/ui/properties_data_armature.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/properties_data_mesh.py | 8 | ||||
-rw-r--r-- | release/scripts/ui/properties_particle.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/properties_physics_common.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/properties_render.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/properties_scene.py | 4 | ||||
-rw-r--r-- | release/scripts/ui/space_view3d.py | 4 | ||||
-rw-r--r-- | release/scripts/ui/space_view3d_toolbar.py | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_animation.c | 14 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 21 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 84 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 26 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_pose.c | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 44 |
14 files changed, 149 insertions, 82 deletions
diff --git a/release/scripts/ui/properties_data_armature.py b/release/scripts/ui/properties_data_armature.py index 3931626f0ff..61c542fa550 100644 --- a/release/scripts/ui/properties_data_armature.py +++ b/release/scripts/ui/properties_data_armature.py @@ -119,7 +119,7 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, bpy.types.Panel): 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) diff --git a/release/scripts/ui/properties_data_mesh.py b/release/scripts/ui/properties_data_mesh.py index 986d1d2e834..af0df284fe4 100644 --- a/release/scripts/ui/properties_data_mesh.py +++ b/release/scripts/ui/properties_data_mesh.py @@ -127,14 +127,14 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel): 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 @@ class DATA_PT_uv_texture(MeshButtonsPanel, bpy.types.Panel): 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 @@ class DATA_PT_vertex_colors(MeshButtonsPanel, bpy.types.Panel): 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="") diff --git a/release/scripts/ui/properties_particle.py b/release/scripts/ui/properties_particle.py index 86072803cfc..5dd7ef7e94b 100644 --- a/release/scripts/ui/properties_particle.py +++ b/release/scripts/ui/properties_particle.py @@ -69,7 +69,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, bpy.types.Panel): 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="") diff --git a/release/scripts/ui/properties_physics_common.py b/release/scripts/ui/properties_physics_common.py index fb9f2f981ae..c4692635ee7 100644 --- a/release/scripts/ui/properties_physics_common.py +++ b/release/scripts/ui/properties_physics_common.py @@ -29,7 +29,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype): 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="") diff --git a/release/scripts/ui/properties_render.py b/release/scripts/ui/properties_render.py index 2072aa00b76..61fea315e2c 100644 --- a/release/scripts/ui/properties_render.py +++ b/release/scripts/ui/properties_render.py @@ -78,7 +78,7 @@ class RENDER_PT_layers(RenderButtonsPanel, bpy.types.Panel): 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="") diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py index 6e25d793683..f5cf54fa315 100644 --- a/release/scripts/ui/properties_scene.py +++ b/release/scripts/ui/properties_scene.py @@ -76,7 +76,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, bpy.types.Panel): 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 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, bpy.types.Panel): 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="") diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py index 3623fc9d591..6adb1461e32 100644 --- a/release/scripts/ui/space_view3d.py +++ b/release/scripts/ui/space_view3d.py @@ -966,14 +966,14 @@ class VIEW3D_MT_vertex_group(bpy.types.Menu): 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 diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py index 9769107a5c9..58923748607 100644 --- a/release/scripts/ui/space_view3d_toolbar.py +++ b/release/scripts/ui/space_view3d_toolbar.py @@ -1300,16 +1300,16 @@ class VIEW3D_PT_tools_particlemode(View3DPanel, bpy.types.Panel): 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: diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index cec7b1cd33c..53f6252a714 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -528,7 +528,6 @@ static void rna_def_keyingset_path(BlenderRNA *brna) } - /* keyingset.paths */ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop) { @@ -585,6 +584,11 @@ static void rna_def_keyingset_paths(BlenderRNA *brna, PropertyRNA *cprop) 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 @@ static void rna_def_keyingset(BlenderRNA *brna) 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); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index a6d79a18670..5576df2e068 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1690,6 +1690,11 @@ static void rna_def_vertex_colors(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Mesh_active_vertex_color_index_get", "rna_Mesh_active_vertex_color_index_set", "rna_Mesh_active_vertex_color_index_range"); + RNA_def_property_ui_text(prop, "Active Vertex Color Index", "Active vertex color index"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } /* mesh.uv_layers */ @@ -1726,6 +1731,11 @@ static void rna_def_uv_textures(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active UV Texture", "Active UV texture"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Mesh_active_uv_texture_index_get", "rna_Mesh_active_uv_texture_index_set", "rna_Mesh_active_uv_texture_index_range"); + RNA_def_property_ui_text(prop, "Active UV Texture Index", "Active UV texture index"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } static void rna_def_mesh(BlenderRNA *brna) @@ -1772,11 +1782,6 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_ui_text(prop, "UV Textures", ""); rna_def_uv_textures(brna, prop); - prop= RNA_def_property(srna, "active_uv_texture_index", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_funcs(prop, "rna_Mesh_active_uv_texture_index_get", "rna_Mesh_active_uv_texture_index_set", "rna_Mesh_active_uv_texture_index_range"); - RNA_def_property_ui_text(prop, "Active UV Texture Index", "Active UV texture index"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); - prop= RNA_def_property(srna, "uv_texture_clone", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_clone_get", "rna_Mesh_uv_texture_clone_set", NULL, NULL); @@ -1806,12 +1811,6 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Vertex Colors", ""); rna_def_vertex_colors(brna, prop); - /* TODO, remove and make a collection property */ - prop= RNA_def_property(srna, "active_vertex_color_index", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_funcs(prop, "rna_Mesh_active_vertex_color_index_get", "rna_Mesh_active_vertex_color_index_set", "rna_Mesh_active_vertex_color_index_range"); - RNA_def_property_ui_text(prop, "Active Vertex Color Index", "Active vertex color index"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); - prop= RNA_def_property(srna, "layers_float", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "fdata.layers", "fdata.totlayer"); RNA_def_property_collection_funcs(prop, "rna_Mesh_float_layers_begin", 0, 0, 0, "rna_Mesh_float_layers_length", 0, 0); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 343e9c87ded..7cfff23b1c6 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1399,7 +1399,7 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(parm, PROP_REQUIRED); } -/* armature.bones.* */ +/* object.modifiers */ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; @@ -1447,6 +1447,63 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(parm, PROP_REQUIRED); } +/* object.particle_systems */ +static void rna_def_object_particle_systems(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + + PropertyRNA *prop; + + // FunctionRNA *func; + // PropertyRNA *parm; + + RNA_def_property_srna(cprop, "ParticleSystems"); + srna= RNA_def_struct(brna, "ParticleSystems", NULL); + RNA_def_struct_sdna(srna, "Object"); + RNA_def_struct_ui_text(srna, "Particle Systems", "Collection of particle systems"); + + prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "ParticleSystem"); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL, NULL); + RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + + prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get", "rna_Object_active_particle_system_index_set", "rna_Object_active_particle_system_index_range"); + RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_particle_update"); +} + + +/* object.vertex_groups */ +static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + + PropertyRNA *prop; + + // FunctionRNA *func; + // PropertyRNA *parm; + + RNA_def_property_srna(cprop, "VertexGroups"); + srna= RNA_def_struct(brna, "VertexGroups", NULL); + RNA_def_struct_sdna(srna, "Object"); + RNA_def_struct_ui_text(srna, "Vertex Groups", "Collection of vertex groups"); + + prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "VertexGroup"); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL, NULL); + RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object"); + RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data"); + + prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "actdef"); + RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range"); + RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array"); + RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data"); +} + + static void rna_def_object(BlenderRNA *brna) { StructRNA *srna; @@ -1796,18 +1853,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "defbase", NULL); RNA_def_property_struct_type(prop, "VertexGroup"); RNA_def_property_ui_text(prop, "Vertex Groups", "Vertex groups of the object"); - - prop= RNA_def_property(srna, "active_vertex_group", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "VertexGroup"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL, NULL); - RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object"); - RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data"); - - prop= RNA_def_property(srna, "active_vertex_group_index", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "actdef"); - RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range"); - RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array"); - RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data"); + rna_def_object_vertex_groups(brna, prop); /* empty */ prop= RNA_def_property(srna, "empty_draw_type", PROP_ENUM, PROP_NONE); @@ -1856,17 +1902,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "particlesystem", NULL); RNA_def_property_struct_type(prop, "ParticleSystem"); RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object"); - - prop= RNA_def_property(srna, "active_particle_system", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "ParticleSystem"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL, NULL); - RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - - prop= RNA_def_property(srna, "active_particle_system_index", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_funcs(prop, "rna_Object_active_particle_system_index_get", "rna_Object_active_particle_system_index_set", "rna_Object_active_particle_system_index_range"); - RNA_def_property_ui_text(prop, "Active Particle System Index", "Index of active particle system slot"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_particle_update"); + rna_def_object_particle_systems(brna, prop); /* restrict */ prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 1eadd0e7676..f019a96844d 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -695,6 +695,26 @@ static EnumPropertyItem *rna_Effector_shape_itemf(bContext *C, PointerRNA *ptr, #else +/* ptcache.point_caches */ +static void rna_def_ptcache_point_caches(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + PropertyRNA *prop; + + // FunctionRNA *func; + // PropertyRNA *parm; + + RNA_def_property_srna(cprop, "PointCaches"); + srna= RNA_def_struct(brna, "PointCaches", NULL); + RNA_def_struct_sdna(srna, "PointCache"); + RNA_def_struct_ui_text(srna, "Point Caches", "Collection of point caches"); + + prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set", "rna_Cache_active_point_cache_index_range"); + RNA_def_property_ui_text(prop, "Active Point Cache Index", ""); + RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change"); +} + static void rna_def_pointcache(BlenderRNA *brna) { StructRNA *srna; @@ -785,11 +805,7 @@ static void rna_def_pointcache(BlenderRNA *brna) RNA_def_property_collection_funcs(prop, "rna_Cache_list_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache List", "Point cache list"); - - prop= RNA_def_property(srna, "active_point_cache_index", PROP_INT, PROP_UNSIGNED); - RNA_def_property_int_funcs(prop, "rna_Cache_active_point_cache_index_get", "rna_Cache_active_point_cache_index_set", "rna_Cache_active_point_cache_index_range"); - RNA_def_property_ui_text(prop, "Active Point Cache Index", ""); - RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_change"); + rna_def_ptcache_point_caches(brna, prop); } static void rna_def_collision(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 73ed2a3ba50..73c27d70b00 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -1155,6 +1155,12 @@ static void rna_def_bone_groups(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get", "rna_Pose_active_bone_group_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose"); RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + + prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "active_group"); + RNA_def_property_int_funcs(prop, "rna_Pose_active_bone_group_index_get", "rna_Pose_active_bone_group_index_set", "rna_Pose_active_bone_group_index_range"); + RNA_def_property_ui_text(prop, "Active Bone Group Index", "Active index in bone groups array"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); } static void rna_def_pose(BlenderRNA *brna) @@ -1179,12 +1185,6 @@ static void rna_def_pose(BlenderRNA *brna) RNA_def_property_struct_type(prop, "BoneGroup"); RNA_def_property_ui_text(prop, "Bone Groups", "Groups of the bones"); rna_def_bone_groups(brna, prop); - - prop= RNA_def_property(srna, "active_bone_group_index", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "active_group"); - RNA_def_property_int_funcs(prop, "rna_Pose_active_bone_group_index_get", "rna_Pose_active_bone_group_index_set", "rna_Pose_active_bone_group_index_range"); - RNA_def_property_ui_text(prop, "Active Bone Group Index", "Active index in bone groups array"); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); /* ik solvers */ prop= RNA_def_property(srna, "ik_solver", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 442c4b64f91..715613cbd80 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1810,6 +1810,29 @@ static void rna_def_scene_render_layer(BlenderRNA *brna) rna_def_render_layer_common(srna, 1); } +/* curve.splines */ +static void rna_def_render_layers(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + PropertyRNA *prop; + + // FunctionRNA *func; + // PropertyRNA *parm; + + RNA_def_property_srna(cprop, "RenderLayers"); + srna= RNA_def_struct(brna, "RenderLayers", NULL); + RNA_def_struct_sdna(srna, "RenderData"); + RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers"); + + prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "actlay"); + RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range"); + RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array"); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + + /* todo - active*/ +} + static void rna_def_scene_render_data(BlenderRNA *brna) { StructRNA *srna; @@ -2750,18 +2773,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "layers", NULL); RNA_def_property_struct_type(prop, "SceneRenderLayer"); RNA_def_property_ui_text(prop, "Render Layers", ""); + rna_def_render_layers(brna, prop); + prop= RNA_def_property(srna, "use_single_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_SINGLE_LAYER); RNA_def_property_ui_text(prop, "Single Layer", "Only render the active layer"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "actlay"); - RNA_def_property_int_funcs(prop, "rna_RenderSettings_active_layer_index_get", "rna_RenderSettings_active_layer_index_set", "rna_RenderSettings_active_layer_index_range"); - RNA_def_property_ui_text(prop, "Active Layer Index", "Active index in render layer array"); - RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - /* engine */ prop= RNA_def_property(srna, "engine", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, engine_items); @@ -2940,6 +2959,12 @@ static void rna_def_scene_keying_sets(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes"); RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL); + + prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "active_keyingset"); + RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL); + RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')"); + RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL); } void RNA_def_scene(BlenderRNA *brna) @@ -3134,13 +3159,6 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_ui_text(prop, "All Keying Sets", "All Keying Sets available for use (builtins and Absolute Keying Sets for this Scene)"); RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL); - /* TODO, move into the collection */ - prop= RNA_def_property(srna, "active_keying_set_index", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "active_keyingset"); - RNA_def_property_int_funcs(prop, "rna_Scene_active_keying_set_index_get", "rna_Scene_active_keying_set_index_set", NULL); - RNA_def_property_ui_text(prop, "Active Keying Set Index", "Current Keying Set index (negative for 'builtin' and positive for 'absolute')"); - RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL); - /* Tool Settings */ prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); |