diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-03 19:07:49 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-03-03 19:07:49 +0400 |
commit | 66a2b848972d47a033f617a40f9a9044756d1d32 (patch) | |
tree | bf30f5bc13e9c0b4f52aacead676a2c07cbb331a /source/blender/makesrna | |
parent | 0c5dfc8a639b04e1767852121b9dee7cd5bb050f (diff) | |
parent | 4774357b594c5cd5a38b21df131b539a197c101b (diff) |
Merged changes in the trunk up to revision 54992.
Resolved conflicts:
release/scripts/startup/bl_ui/space_view3d.py
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_rigidbody.c | 19 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 13 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene_api.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 30 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_tracking.c | 3 |
10 files changed, 73 insertions, 26 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 585e08ea706..44792951cad 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -290,6 +290,9 @@ add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC}) target_link_libraries(makesrna bf_dna) target_link_libraries(makesrna bf_dna_blenlib) +# too many warnings with clang +remove_cc_flag("-Wmissing-prototypes") + # Output rna_*_gen.c # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes add_custom_command( diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index adfb096b25f..6035326e0ae 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -3196,18 +3196,16 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro return 0; } + /* check item array */ + itemlen = RNA_property_array_length(&itemptr, itemprop); + /* dynamic array? need to get length per item */ if (itemprop->getlength) { itemprop = NULL; } /* try to access as raw array */ else if (RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) { - int arraylen; - - /* check item array */ - itemlen = RNA_property_array_length(&itemptr, itemprop); - - arraylen = (itemlen == 0) ? 1 : itemlen; + int arraylen = (itemlen == 0) ? 1 : itemlen; if (in.len != arraylen * out.len) { BKE_reportf(reports, RPT_ERROR, "Array length mismatch (expected %d, got %d)", out.len * arraylen, in.len); @@ -4866,7 +4864,7 @@ static char *rna_pointer_as_string__bldata(PointerRNA *ptr) } } -char *RNA_pointer_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop_ptr, PointerRNA *ptr_prop) +char *RNA_pointer_as_string(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *prop_ptr, PointerRNA *ptr_prop) { if (RNA_property_flag(prop_ptr) & PROP_IDPROPERTY) { return rna_pointer_as_string__idprop(C, ptr_prop); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 1fff567f25c..73fe5f3a48d 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2412,7 +2412,12 @@ static void def_cmp_image(StructRNA *srna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Image", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); - + + prop = RNA_def_property(srna, "use_straight_alpha_output", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "custom1", CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT); + RNA_def_property_ui_text(prop, "Straight Alpha Output", "Put Node output buffer to straight alpha instead of premultiplied"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + /* NB: image user properties used in the UI are redefined in def_node_image_user, * to trigger correct updates of the node editor. RNA design problem that prevents * updates from nested structs ... diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index d6f3f594395..4bf5de03b05 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -2892,7 +2892,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_float_funcs(prop, "rna_PartSetting_linelentail_get", "rna_PartSetting_linelentail_set", NULL); RNA_def_property_range(prop, 0.0f, 100000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); - RNA_def_property_ui_text(prop, "Back", "Length of the line's tail"); + RNA_def_property_ui_text(prop, "Tail", "Length of the line's tail"); RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop = RNA_def_property(srna, "line_length_head", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 5931440b422..e2e373d8beb 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -299,19 +299,19 @@ static void rna_def_render_engine(BlenderRNA *brna) /* final render callbacks */ func = RNA_def_function(srna, "update", NULL); RNA_def_function_ui_description(func, "Export scene data for render"); - RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); + RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); RNA_def_pointer(func, "data", "BlendData", "", ""); RNA_def_pointer(func, "scene", "Scene", "", ""); func = RNA_def_function(srna, "render", NULL); RNA_def_function_ui_description(func, "Render scene into an image"); - RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); + RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); RNA_def_pointer(func, "scene", "Scene", "", ""); /* viewport render callbacks */ func = RNA_def_function(srna, "view_update", NULL); RNA_def_function_ui_description(func, "Update on data changes for viewport render"); - RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); + RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE); RNA_def_pointer(func, "context", "Context", "", ""); func = RNA_def_function(srna, "view_draw", NULL); diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c index f5cf247b5a1..171bc702bc5 100644 --- a/source/blender/makesrna/intern/rna_rigidbody.c +++ b/source/blender/makesrna/intern/rna_rigidbody.c @@ -234,6 +234,20 @@ static void rna_RigidBodyOb_collision_margin_set(PointerRNA *ptr, float value) #endif } +static void rna_RigidBodyOb_collision_groups_set(PointerRNA *ptr, const int *values) +{ + RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; + int i; + + for (i = 0; i < 20; i++) { + if (values[i]) + rbo->col_groups |= (1 << i); + else + rbo->col_groups &= ~(1 << i); + } + rbo->flag |= RBO_FLAG_NEEDS_VALIDATE; +} + static void rna_RigidBodyOb_kinematic_state_set(PointerRNA *ptr, int value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; @@ -812,6 +826,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) prop = RNA_def_property(srna, "collision_groups", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "col_groups", 1); RNA_def_property_array(prop, 20); + RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyOb_collision_groups_set"); RNA_def_property_ui_text(prop, "Collision Groups", "Collision Groups Rigid Body belongs to"); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); @@ -949,13 +964,13 @@ static void rna_def_rigidbody_constraint(BlenderRNA *brna) prop = RNA_def_property(srna, "use_motor_lin", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_MOTOR_LIN); RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyCon_use_motor_lin_set"); - RNA_def_property_ui_text(prop, "Linear Motor", "Enables linear motor"); + RNA_def_property_ui_text(prop, "Linear Motor", "Enable linear motor"); RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset"); prop = RNA_def_property(srna, "use_motor_ang", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_MOTOR_ANG); RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyCon_use_motor_ang_set"); - RNA_def_property_ui_text(prop, "Angular Motor", "Enables angular motor"); + RNA_def_property_ui_text(prop, "Angular Motor", "Enable angular motor"); RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset"); prop = RNA_def_property(srna, "limit_lin_x_lower", PROP_FLOAT, PROP_UNIT_LENGTH); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 20269005b3f..906c8853179 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -916,16 +916,13 @@ static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(bCon EnumPropertyItem tmp = {0, "", 0, "", ""}; QuicktimeCodecTypeDesc *codecTypeDesc; int i = 1, totitem = 0; - char id[5]; - + for (i = 0; i < quicktime_get_num_videocodecs(); i++) { codecTypeDesc = quicktime_get_videocodecType_desc(i); if (!codecTypeDesc) break; - + tmp.value = codecTypeDesc->rnatmpvalue; - *((int *)id) = codecTypeDesc->codecType; - id[4] = 0; - tmp.identifier = id; + tmp.identifier = codecTypeDesc->codecName; tmp.name = codecTypeDesc->codecName; RNA_enum_item_add(&item, &totitem, &tmp); } @@ -1586,8 +1583,8 @@ static void rna_def_tool_settings(BlenderRNA *brna) static EnumPropertyItem draw_groupuser_items[] = { {OB_DRAW_GROUPUSER_NONE, "NONE", 0, "None", ""}, - {OB_DRAW_GROUPUSER_ACTIVE, "ACTIVE", 0, "Active", "Show vertices with no weights in the actuve group"}, - {OB_DRAW_GROUPUSER_ALL, "ALL", 0, "All", "Show vertices with no weights in the any group"}, + {OB_DRAW_GROUPUSER_ACTIVE, "ACTIVE", 0, "Active", "Show vertices with no weights in the active group"}, + {OB_DRAW_GROUPUSER_ALL, "ALL", 0, "All", "Show vertices with no weights in any group"}, {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index b0df27b957b..b3619330e7a 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -111,6 +111,7 @@ static void rna_Scene_collada_export( int include_material_textures, int use_texture_copies, + int use_ngons, int use_object_instantiation, int sort_by_name, int second_life) @@ -118,7 +119,7 @@ static void rna_Scene_collada_export( collada_export(scene, filepath, apply_modifiers, export_mesh_type, selected, include_children, include_armatures, include_shapekeys, deform_bones_only, active_uv_only, include_uv_textures, include_material_textures, - use_texture_copies, use_object_instantiation, sort_by_name, second_life); + use_texture_copies, use_ngons, use_object_instantiation, sort_by_name, second_life); } #endif @@ -160,6 +161,7 @@ void RNA_api_scene(StructRNA *srna) parm = RNA_def_boolean(func, "include_material_textures", 0, "Include Material Textures", "Export textures assigned to the object Materials"); parm = RNA_def_boolean(func, "use_texture_copies", 0, "copy", "Copy textures to same folder where the .dae file is exported"); + parm = RNA_def_boolean(func, "use_ngons", 1, "Use NGons", "Keep NGons in Export"); parm = RNA_def_boolean(func, "use_object_instantiation", 1, "Use Object Instances", "Instantiate multiple Objects from same Data"); parm = RNA_def_boolean(func, "sort_by_name", 0, "Sort by Object name", "Sort exported data by Object name"); parm = RNA_def_boolean(func, "second_life", 0, "Export for Second Life", "Compatibility mode for Second Life"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 7dc2dbf3d03..f1f4c13731f 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2249,6 +2249,13 @@ static void rna_def_space_sequencer(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static EnumPropertyItem preview_channels_items[] = { + {SEQ_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", + "Draw image with RGB colors and alpha transparency"}, + {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors"}, + {0, NULL, 0, NULL, NULL} + }; + srna = RNA_def_struct(brna, "SpaceSequenceEditor", "Space"); RNA_def_struct_sdna(srna, "SpaceSeq"); RNA_def_struct_ui_text(srna, "Space Sequence Editor", "Sequence editor space data"); @@ -2266,7 +2273,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_enum_items(prop, display_mode_items); RNA_def_property_ui_text(prop, "Display Mode", "View mode to use for displaying sequencer output"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - + /* flags */ prop = RNA_def_property(srna, "show_frame_indicator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_NO_DRAW_CFRANUM); @@ -2311,7 +2318,13 @@ static void rna_def_space_sequencer(BlenderRNA *brna) "The channel number shown in the image preview. 0 is the result of all strips combined"); RNA_def_property_range(prop, -5, MAXSEQ); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); - + + prop = RNA_def_property(srna, "preview_channels", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, preview_channels_items); + RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the preview to draw"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL); + prop = RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "zebra"); RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes"); @@ -3042,13 +3055,24 @@ static void rna_def_space_info(BlenderRNA *brna) static void rna_def_space_userpref(BlenderRNA *brna) { + static EnumPropertyItem filter_type_items[] = { + {0, "NAME", 0, "Name", "Filter based on the operator name"}, + {1, "KEY", 0, "Key-Binding", "Filter based on key bindings"}, + {0, NULL, 0, NULL, NULL}}; + StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "SpaceUserPreferences", "Space"); RNA_def_struct_sdna(srna, "SpaceUserPref"); RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data"); - + + prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "filter_type"); + RNA_def_property_enum_items(prop, filter_type_items); + RNA_def_property_ui_text(prop, "Filter Type", "Filter method"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, NULL); + prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "filter"); RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI"); diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index cd646f4849c..798395b9fef 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -579,6 +579,9 @@ static void rna_def_trackingSettings(BlenderRNA *brna) {REFINE_FOCAL_LENGTH | REFINE_PRINCIPAL_POINT, "FOCAL_LENGTH_PRINCIPAL_POINT", 0, "Focal Length, Optical Center", "Refine focal length and optical center"}, + {REFINE_RADIAL_DISTORTION_K1 | + REFINE_RADIAL_DISTORTION_K2, "RADIAL_K1_K2", 0, "K1, K2", + "Refine radial distortion K1 and K2"}, {0, NULL, 0, NULL, NULL} }; |