diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-07-05 17:54:25 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-07-05 17:54:25 +0400 |
commit | 3f3c6f5f1fb336f8f0015d7857a1ae153fa2a80f (patch) | |
tree | 27e2ae66dd589013c24592fe0803b440a7e014be /source/blender/makesrna/intern | |
parent | 887fd19894047832fbb7a7300e5fc11438b1f3b2 (diff) | |
parent | ccd31900ab9659b6fdc035fd91bff9f508334e22 (diff) |
Merging from trunk up to r38119.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_armature.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 13 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 29 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene_api.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 13 |
13 files changed, 78 insertions, 28 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 174cf95e755..3ce84e3a19f 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -410,15 +410,15 @@ static void rna_def_ID_materials(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "ID Materials", "Collection of materials"); func= RNA_def_function(srna, "append", "material_append_id"); - RNA_def_function_ui_description(func, "Add a new material to Mesh."); + RNA_def_function_ui_description(func, "Add a new material to the data block."); parm= RNA_def_pointer(func, "material", "Material", "", "Material to add."); RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "pop", "material_pop_id"); - RNA_def_function_ui_description(func, "Add a new material to Mesh."); - parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "", "Frame number to set.", 0, INT_MAX); + RNA_def_function_ui_description(func, "Remove a material from the data block."); + parm= RNA_def_int(func, "index", 0, 0, INT_MAX, "", "Index of material to remove.", 0, INT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "material", "Material", "", "Material to add."); + parm= RNA_def_pointer(func, "material", "Material", "", "Material to remove."); RNA_def_function_return(func, parm); } diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index d2742f421f3..285e8ca39ba 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2839,7 +2839,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro } /* editable check */ - if(RNA_property_editable(&itemptr, iprop)) { + if(!set || RNA_property_editable(&itemptr, iprop)) { if(a+itemlen > in.len) { BKE_reportf(reports, RPT_ERROR, "Array length mismatch (got %d, expected more).", in.len); err= 1; diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 41d169a8870..3f58723a929 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -509,6 +509,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) prop= RNA_def_property(srna, "head_radius", PROP_FLOAT, PROP_UNSIGNED); if(editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); + else RNA_def_property_update(prop, 0, "rna_Armature_update_data"); RNA_def_property_float_sdna(prop, NULL, "rad_head"); //RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3); @@ -516,6 +517,7 @@ static void rna_def_bone_common(StructRNA *srna, int editbone) prop= RNA_def_property(srna, "tail_radius", PROP_FLOAT, PROP_UNSIGNED); if(editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); + else RNA_def_property_update(prop, 0, "rna_Armature_update_data"); RNA_def_property_float_sdna(prop, NULL, "rad_tail"); //RNA_def_property_range(prop, 0, 1000); // XXX range is 0 to lim, where lim= 10000.0f*MAX2(1.0, view3d->grid); RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 594295ba817..f2811e7320b 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -281,8 +281,7 @@ static int rna_Nurb_length(PointerRNA *ptr) static void rna_Nurb_type_set(PointerRNA *ptr, int value) { Nurb *nu= (Nurb*)ptr->data; - nu->type = value; - // XXX - TODO change datatypes + ED_nurb_set_spline_type(nu, value); } static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) @@ -1448,7 +1447,6 @@ static void rna_def_curve_nurb(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Radius Interpolation", "The type of radius interpolation for Bezier curves"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - // XXX - switching type probably needs comprehensive recalc of data like in 2.4x prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, curve_type_items); RNA_def_property_enum_funcs(prop, NULL, "rna_Nurb_type_set", NULL); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index b86a91967a6..f407aba82fb 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -1675,7 +1675,12 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Light Group", "Limit lighting to lamps in this Group"); RNA_def_property_update(prop, 0, "rna_Material_update"); - + + prop= RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED); + RNA_def_property_int_sdna(prop, NULL, "index"); + RNA_def_property_ui_text(prop, "Pass Index", "Index # for the IndexMA render pass"); + RNA_def_property_update(prop, NC_OBJECT, NULL); + /* flags */ prop= RNA_def_property(srna, "use_light_group_exclusive", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 6b925b42e06..dd66e49fdec 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -270,11 +270,16 @@ static void rna_Base_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po static void rna_Object_layer_update__internal(Main *bmain, Scene *scene, Base *base, Object *ob) { /* try to avoid scene sort */ - if((ob->lay & scene->lay) && (base->lay & scene->lay)) { + if(scene == NULL) { + /* pass - unlikely but when running scripts on startup it happens */ + } + else if((ob->lay & scene->lay) && (base->lay & scene->lay)) { /* pass */ - } else if((ob->lay & scene->lay)==0 && (base->lay & scene->lay)==0) { + } + else if((ob->lay & scene->lay)==0 && (base->lay & scene->lay)==0) { /* pass */ - } else { + } + else { DAG_scene_sort(bmain, scene); } } @@ -284,7 +289,7 @@ static void rna_Object_layer_update(Main *bmain, Scene *scene, PointerRNA *ptr) Object *ob= (Object*)ptr->id.data; Base *base; - base= object_in_scene(ob, scene); + base= scene ? object_in_scene(ob, scene) : NULL; if(!base) return; diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 4913e98a0af..30fce5716a9 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1757,11 +1757,6 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Absolute Path Time", "Path timing is in absolute frames"); RNA_def_property_update(prop, 0, "rna_Particle_abspathtime_update"); - prop= RNA_def_property(srna, "lock_billboard", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK); - RNA_def_property_ui_text(prop, "Lock Billboard", "Lock the billboards align axis"); - RNA_def_property_update(prop, 0, "rna_Particle_redo"); - prop= RNA_def_property(srna, "use_parent_particles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_PARENT); RNA_def_property_ui_text(prop, "Parents", "Render parent particles"); @@ -1910,6 +1905,11 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* billboards */ + prop= RNA_def_property(srna, "lock_billboard", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK); + RNA_def_property_ui_text(prop, "Lock Billboard", "Lock the billboards align axis"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); + prop= RNA_def_property(srna, "billboard_align", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "bb_align"); RNA_def_property_enum_items(prop, bb_align_items); @@ -1958,6 +1958,25 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Billboard Offset", ""); RNA_def_property_update(prop, 0, "rna_Particle_redo"); + prop= RNA_def_property(srna, "billboard_size", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "bb_size"); + RNA_def_property_array(prop, 2); + RNA_def_property_range(prop, 0.001f, 10.0f); + RNA_def_property_ui_text(prop, "Billboard Scale", "Scale billboards relative to particle size"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); + + prop= RNA_def_property(srna, "billboard_velocity_head", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "bb_vel_head"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_ui_text(prop, "Billboard Velocity Head", "Scale billboards by velocity"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); + + prop= RNA_def_property(srna, "billboard_velocity_tail", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "bb_vel_tail"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_ui_text(prop, "Billboard Velocity Tail", "Scale billboards by velocity"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); + /* simplification */ prop= RNA_def_property(srna, "use_simplify", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "simplify_flag", PART_SIMPLIFY_ENABLE); diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 6638a9d76d3..e3e3296cb70 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -32,6 +32,7 @@ #include "DNA_scene_types.h" #include "RNA_define.h" +#include "RNA_enum_types.h" #include "rna_internal.h" @@ -271,6 +272,12 @@ static void rna_def_render_engine(BlenderRNA *brna) prop= RNA_def_string(func, "info", "", 0, "Info", ""); RNA_def_property_flag(prop, PROP_REQUIRED); + func= RNA_def_function(srna, "report", "RE_engine_report"); + prop= RNA_def_enum_flag(func, "type", wm_report_items, 0, "Type", ""); + RNA_def_property_flag(prop, PROP_REQUIRED); + prop= RNA_def_string(func, "message", "", 0, "Report Message", ""); + RNA_def_property_flag(prop, PROP_REQUIRED); + /* registration */ RNA_define_verify_sdna(0); @@ -381,6 +388,7 @@ static void rna_def_render_pass(BlenderRNA *brna) {SCE_PASS_MIST, "MIST", 0, "Mist", ""}, {SCE_PASS_EMIT, "EMIT", 0, "Emit", ""}, {SCE_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""}, + {SCE_PASS_INDEXMA, "MATERIAL_INDEX", 0, "Material Index", ""}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "RenderPass", NULL); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index b4da3a02442..e063f8ec85a 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -1067,7 +1067,7 @@ static void rna_def_property(BlenderRNA *brna) prop= RNA_def_property(srna, "is_runtime", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Property_runtime_get", NULL); - RNA_def_property_ui_text(prop, "Read Only", "Property is editable through RNA"); + RNA_def_property_ui_text(prop, "Runtime", "Property has been dynamically created at runtime"); prop= RNA_def_property(srna, "is_enum_flag", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index cf5b38aeb3a..b21e54bf6b0 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1527,6 +1527,12 @@ void rna_def_render_layer_common(StructRNA *srna, int scene) if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); else RNA_def_property_clear_flag(prop, PROP_EDITABLE); + prop= RNA_def_property(srna, "use_pass_material_index", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_INDEXMA); + RNA_def_property_ui_text(prop, "Material Index", "Deliver material index pass"); + if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); + else RNA_def_property_clear_flag(prop, PROP_EDITABLE); + prop= RNA_def_property(srna, "use_pass_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "passflag", SCE_PASS_RGBA); RNA_def_property_ui_text(prop, "Color", "Deliver shade-less color pass"); diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index c2194636cd3..1220c4f34a1 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -85,9 +85,9 @@ static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name /* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */ #include "../../collada/collada.h" -static void rna_Scene_collada_export(Scene *scene, const char *filepath) +static void rna_Scene_collada_export(Scene *scene, const char *filepath, int selected) { - collada_export(scene, filepath); + collada_export(scene, filepath, selected); } #endif @@ -112,6 +112,7 @@ void RNA_api_scene(StructRNA *srna) /* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */ func= RNA_def_function(srna, "collada_export", "rna_Scene_collada_export"); parm= RNA_def_string(func, "filepath", "", FILE_MAX, "File Path", "File path to write Collada file."); + parm= RNA_def_boolean(func, "selected", 0, "Export only selected", "Export only selected elements."); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */ RNA_def_function_ui_description(func, "Export to collada file."); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 9dab340cfe1..fccd00d36df 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -990,7 +990,12 @@ static void rna_def_space_image_uv(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS); RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); - + + prop= RNA_def_property(srna, "show_faces", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SI_NO_DRAWFACES); + RNA_def_property_ui_text(prop, "Draw Faces", "Draw faces over the image"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); + prop= RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_SpaceImageEditor_cursor_location_get", "rna_SpaceImageEditor_cursor_location_set", NULL); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 23060ba1aee..4a4b712ca40 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -361,36 +361,37 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) RNA_def_struct_sdna(srna, "uiStyle"); RNA_def_struct_ui_text(srna, "Style", "Theme settings for style sets"); + /* (not used yet) prop= RNA_def_property(srna, "panelzoom", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.5, 2.0); RNA_def_property_ui_text(prop, "Panel Zoom", "Default zoom level for panel areas"); - + */ prop= RNA_def_property(srna, "panel_title", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "paneltitle"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); - RNA_def_property_ui_text(prop, "Panel Font", ""); + RNA_def_property_ui_text(prop, "Panel Style", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - +/* (not used yet) prop= RNA_def_property(srna, "group_label", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "grouplabel"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Group Label Font", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); - +*/ prop= RNA_def_property(srna, "widget_label", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); - RNA_def_property_ui_text(prop, "Widget Label Font", ""); + RNA_def_property_ui_text(prop, "Widget Label Style", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "widget"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); - RNA_def_property_ui_text(prop, "Widget Font", ""); + RNA_def_property_ui_text(prop, "Widget Style", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); } |