diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index cbc80e68b4a..32af373862b 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -42,6 +42,7 @@ #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_material.h" +#include "BKE_particle.h" static void rna_Object_update(bContext *C, PointerRNA *ptr) { @@ -202,6 +203,13 @@ static void rna_Object_active_material_link_set(PointerRNA *ptr, int value) ob->colbits &= ~(1<<(ob->actcol)); } +static PointerRNA rna_Object_active_particle_system_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + ParticleSystem *psys= psys_get_current(ob); + return rna_pointer_inherit_refine(ptr, &RNA_ParticleSystem, psys); +} + static PointerRNA rna_Object_game_settings_get(PointerRNA *ptr) { return rna_pointer_inherit_refine(ptr, &RNA_GameObjectSettings, ptr->id.data); @@ -513,6 +521,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna) srna= RNA_def_struct(brna, "Object", "ID"); RNA_def_struct_ui_text(srna, "Object", "Object datablock defining an object in a scene.."); + RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); @@ -556,6 +565,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Parent Bone", "Name of parent bone in case of a bone parenting relation."); prop= RNA_def_property(srna, "track", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_EDITABLE); 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); @@ -584,7 +594,6 @@ static StructRNA *rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Materials", ""); prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Material"); RNA_def_property_pointer_funcs(prop, "rna_Object_active_material_get", NULL); RNA_def_property_ui_text(prop, "Active Material", "Active material being displayed."); @@ -596,7 +605,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "active_material_link", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, material_link_items); - RNA_def_property_enum_funcs(prop, "rna_Object_active_material_link_get", "rna_Object_active_material_link_set"); + RNA_def_property_enum_funcs(prop, "rna_Object_active_material_link_get", "rna_Object_active_material_link_set", NULL); RNA_def_property_ui_text(prop, "Active Material Link", "Use material from object or data for the active material."); /* transform */ @@ -719,6 +728,11 @@ static StructRNA *rna_def_object(BlenderRNA *brna) 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); + RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed"); + /* restrict */ prop= RNA_def_property(srna, "restrict_view", PROP_BOOLEAN, PROP_NONE); @@ -765,6 +779,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "dupli_frames_no_speed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLINOSPEED); RNA_def_property_ui_text(prop, "Dupli Frames No Speed", "Set dupliframes to still, regardless of frame."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); prop= RNA_def_property(srna, "dupli_verts_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT); @@ -774,6 +789,7 @@ static StructRNA *rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "dupli_faces_inherit_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_DUPLIROT); RNA_def_property_ui_text(prop, "Dupli Faces Inherit Scale", "Scale dupli based on face size."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); prop= RNA_def_property(srna, "dupli_faces_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dupfacesca"); @@ -783,27 +799,33 @@ static StructRNA *rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "dupli_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "dup_group"); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Dupli Group", "Instance an existing group."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update"); prop= RNA_def_property(srna, "dupli_frames_start", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dupsta"); RNA_def_property_range(prop, 1, 32767); RNA_def_property_ui_text(prop, "Dupli Frames Start", "Start frame for DupliFrames."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); prop= RNA_def_property(srna, "dupli_frames_end", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dupend"); RNA_def_property_range(prop, 1, 32767); RNA_def_property_ui_text(prop, "Dupli Frames End", "End frame for DupliFrames."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); prop= RNA_def_property(srna, "dupli_frames_on", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dupon"); RNA_def_property_range(prop, 1, 1500); RNA_def_property_ui_text(prop, "Dupli Frames On", "Number of frames to use between DupOff frames."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); prop= RNA_def_property(srna, "dupli_frames_off", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dupoff"); RNA_def_property_range(prop, 0, 1500); RNA_def_property_ui_text(prop, "Dupli Frames Off", "Recurring frames to exclude from the Dupliframes."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); /* time offset */ @@ -836,7 +858,6 @@ static StructRNA *rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "script_link", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "scriptlink"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Script Link", "Scripts linked to this object."); /* drawing */ |