diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 18 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 5 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 3 | ||||
-rw-r--r-- | source/blender/editors/metaball/mball_edit.c | 3 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 2 | ||||
-rw-r--r-- | source/blender/editors/render/render_internal.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 28 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 65 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_enum_types.h | 2 |
13 files changed, 70 insertions, 65 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index c53871cabd2..33bff1cd6a7 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -258,6 +258,7 @@ int seq_single_check(struct Sequence *seq); void seq_single_fix(struct Sequence *seq); int seq_test_overlap(struct ListBase * seqbasep, struct Sequence *test); void seq_translate(struct Scene *scene, struct Sequence *seq, int delta); +void seq_sound_init(struct Scene *scene, struct Sequence *seq); struct Sequence *seq_foreground_frame_get(struct Scene *scene, int frame); struct ListBase *seq_seqbase(struct ListBase *seqbase, struct Sequence *seq); void seq_offset_animdata(struct Scene *scene, struct Sequence *seq, int ofs); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 98a982824ba..67d79709c4f 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -2974,6 +2974,24 @@ void seq_translate(Scene *evil_scene, Sequence *seq, int delta) calc_sequence_disp(evil_scene, seq); } +void seq_sound_init(Scene *scene, Sequence *seq) +{ + if(seq->type==SEQ_META) { + Sequence *seq_child; + for(seq_child= seq->seqbase.first; seq_child; seq_child= seq_child->next) { + seq_sound_init(scene, seq_child); + } + } + else { + if(seq->sound) { + seq->scene_sound = sound_add_scene_sound(scene, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs); + } + if(seq->scene) { + sound_scene_add_scene_sound(scene, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs); + } + } +} + Sequence *seq_foreground_frame_get(Scene *scene, int frame) { Editing *ed= seq_give_editing(scene, FALSE); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 12d1327da68..9b5f1546898 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -87,6 +87,7 @@ #include "RNA_access.h" #include "RNA_define.h" +#include "RNA_enum_types.h" /* Undo stuff */ typedef struct { @@ -4755,7 +4756,7 @@ void CURVE_OT_extrude(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); + RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); } /***************** make cyclic operator **********************/ @@ -5629,7 +5630,7 @@ void CURVE_OT_duplicate(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); + RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); } /********************** delete operator *********************/ diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index bd094211270..ec84d7f830f 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -45,6 +45,7 @@ #include "RNA_define.h" #include "RNA_access.h" +#include "RNA_enum_types.h" #include "BLI_blenlib.h" #include "BLI_math.h" @@ -1768,6 +1769,6 @@ void MESH_OT_duplicate(wmOperatorType *ot) ot->poll= ED_operator_editmesh; /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); + RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); } diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index 1cbd7e82b95..d47e02dc63c 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -48,6 +48,7 @@ #include "RNA_define.h" #include "RNA_access.h" +#include "RNA_enum_types.h" #include "BKE_depsgraph.h" #include "BKE_context.h" @@ -326,7 +327,7 @@ void MBALL_OT_duplicate_metaelems(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); + RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); } /***************************** Delete operator *****************************/ diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index f630b05d8f2..c5fbc41902f 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1703,7 +1703,7 @@ void OBJECT_OT_duplicate(wmOperatorType *ot) /* to give to transform */ RNA_def_boolean(ot->srna, "linked", 0, "Linked", "Duplicate object but not object data, linking to the original data."); - prop= RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); + prop= RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); RNA_def_property_flag(prop, PROP_HIDDEN); } diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 39def19aa17..857a36c3029 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -171,7 +171,7 @@ void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volat float *rf= rectf; char *rc= rectc; float rgb[3]; - const float dither = ibuf->dither / 255.0; + const float dither = ibuf->dither / 255.0f; /* XXX temp. because crop offset */ if( rectc >= (char *)(ibuf->rect)) { diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 0a98178a890..b3aa9349da8 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -711,7 +711,7 @@ void ACTION_OT_duplicate (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TIME_TRANSLATE, 0, INT_MAX, "Mode", "", 0, INT_MAX); + RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); } /* ******************** Delete Keyframes Operator ************************* */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 1bb6e6f6edb..962cadba1f3 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -830,7 +830,7 @@ void GRAPH_OT_duplicate (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); + RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); } /* ******************** Delete Keyframes Operator ************************* */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index d9cd11b751f..d058ea746b6 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -678,7 +678,7 @@ void NLA_OT_duplicate (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); + RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); } /* ******************** Delete Strips Operator ***************************** */ diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 48bdcb88618..048581e207e 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -62,6 +62,7 @@ #include "WM_types.h" #include "RNA_define.h" +#include "RNA_enum_types.h" /* for menu/popup icons etc etc*/ @@ -1678,7 +1679,7 @@ void SEQUENCER_OT_duplicate(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); + RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); } /* delete operator */ @@ -2671,21 +2672,6 @@ void SEQUENCER_OT_copy(wmOperatorType *ot) /* properties */ } -static void seq_offset(Scene *scene, Sequence *seq, int ofs) -{ - if(seq->type == SEQ_META) { - Sequence *iseq; - for(iseq= seq->seqbase.first; iseq; iseq= iseq->next) { - seq_offset(scene, iseq, ofs); - } - } - else { - seq->start += ofs; - } - - calc_sequence_disp(scene, seq); -} - static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op)) { Scene *scene= CTX_data_scene(C); @@ -2702,14 +2688,8 @@ static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op)) /* transform pasted strips before adding */ if(ofs) { for(iseq= nseqbase.first; iseq; iseq= iseq->next) { - seq_offset(scene, iseq, ofs); - /* XXX, ffmpeg too? */ - if(iseq->sound) { - iseq->scene_sound = sound_add_scene_sound(scene, iseq, iseq->startdisp, iseq->enddisp, iseq->startofs + iseq->anim_startofs); - } - if(iseq->scene) { - sound_scene_add_scene_sound(scene, iseq, iseq->startdisp, iseq->enddisp, iseq->startofs + iseq->anim_startofs); - } + seq_translate(scene, iseq, ofs); + seq_sound_init(scene, iseq); } } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 9a78a05dba9..4edaabb9508 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -110,6 +110,39 @@ static TransformModeItem transform_modes[] = {NULL, 0} }; +EnumPropertyItem transform_mode_types[] = +{ + {TFM_INIT, "INIT", 0, "Init", ""}, + {TFM_DUMMY, "DUMMY", 0, "Dummy", ""}, + {TFM_TRANSLATION, "TRANSLATION", 0, "Translation", ""}, + {TFM_ROTATION, "ROTATION", 0, "Rotation", ""}, + {TFM_RESIZE, "RESIZE", 0, "Resize", ""}, + {TFM_TOSPHERE, "TOSPHERE", 0, "Tosphere", ""}, + {TFM_SHEAR, "SHEAR", 0, "Shear", ""}, + {TFM_WARP, "WARP", 0, "Warp", ""}, + {TFM_SHRINKFATTEN, "SHRINKFATTEN", 0, "Shrinkfatten", ""}, + {TFM_TILT, "TILT", 0, "Tilt", ""}, + {TFM_TRACKBALL, "TRACKBALL", 0, "Trackball", ""}, + {TFM_PUSHPULL, "PUSHPULL", 0, "Pushpull", ""}, + {TFM_CREASE, "CREASE", 0, "Crease", ""}, + {TFM_MIRROR, "MIRROR", 0, "Mirror", ""}, + {TFM_BONESIZE, "BONE_SIZE", 0, "Bonesize", ""}, + {TFM_BONE_ENVELOPE, "BONE_ENVELOPE", 0, "Bone_Envelope", ""}, + {TFM_CURVE_SHRINKFATTEN, "CURVE_SHRINKFATTEN", 0, "Curve_Shrinkfatten", ""}, + {TFM_BONE_ROLL, "BONE_ROLL", 0, "Bone_Roll", ""}, + {TFM_TIME_TRANSLATE, "TIME_TRANSLATE", 0, "Time_Translate", ""}, + {TFM_TIME_SLIDE, "TIME_SLIDE", 0, "Time_Slide", ""}, + {TFM_TIME_SCALE, "TIME_SCALE", 0, "Time_Scale", ""}, + {TFM_TIME_EXTEND, "TIME_EXTEND", 0, "Time_Extend", ""}, + {TFM_BAKE_TIME, "BAKE_TIME", 0, "Bake_Time", ""}, + {TFM_BEVEL, "BEVEL", 0, "Bevel", ""}, + {TFM_BWEIGHT, "BWEIGHT", 0, "Bweight", ""}, + {TFM_ALIGN, "ALIGN", 0, "Align", ""}, + {TFM_EDGE_SLIDE, "EDGESLIDE", 0, "Edge Slide", ""}, + {TFM_SEQ_SLIDE, "SEQSLIDE", 0, "Sequence Slide", ""}, + {0, NULL, 0, NULL, NULL} +}; + static int snap_type_exec(bContext *C, wmOperator *op) { ToolSettings *ts= CTX_data_tool_settings(C); @@ -757,38 +790,6 @@ void TRANSFORM_OT_transform(struct wmOperatorType *ot) { PropertyRNA *prop; - static EnumPropertyItem transform_mode_types[] = { - {TFM_INIT, "INIT", 0, "Init", ""}, - {TFM_DUMMY, "DUMMY", 0, "Dummy", ""}, - {TFM_TRANSLATION, "TRANSLATION", 0, "Translation", ""}, - {TFM_ROTATION, "ROTATION", 0, "Rotation", ""}, - {TFM_RESIZE, "RESIZE", 0, "Resize", ""}, - {TFM_TOSPHERE, "TOSPHERE", 0, "Tosphere", ""}, - {TFM_SHEAR, "SHEAR", 0, "Shear", ""}, - {TFM_WARP, "WARP", 0, "Warp", ""}, - {TFM_SHRINKFATTEN, "SHRINKFATTEN", 0, "Shrinkfatten", ""}, - {TFM_TILT, "TILT", 0, "Tilt", ""}, - {TFM_TRACKBALL, "TRACKBALL", 0, "Trackball", ""}, - {TFM_PUSHPULL, "PUSHPULL", 0, "Pushpull", ""}, - {TFM_CREASE, "CREASE", 0, "Crease", ""}, - {TFM_MIRROR, "MIRROR", 0, "Mirror", ""}, - {TFM_BONESIZE, "BONE_SIZE", 0, "Bonesize", ""}, - {TFM_BONE_ENVELOPE, "BONE_ENVELOPE", 0, "Bone_Envelope", ""}, - {TFM_CURVE_SHRINKFATTEN, "CURVE_SHRINKFATTEN", 0, "Curve_Shrinkfatten", ""}, - {TFM_BONE_ROLL, "BONE_ROLL", 0, "Bone_Roll", ""}, - {TFM_TIME_TRANSLATE, "TIME_TRANSLATE", 0, "Time_Translate", ""}, - {TFM_TIME_SLIDE, "TIME_SLIDE", 0, "Time_Slide", ""}, - {TFM_TIME_SCALE, "TIME_SCALE", 0, "Time_Scale", ""}, - {TFM_TIME_EXTEND, "TIME_EXTEND", 0, "Time_Extend", ""}, - {TFM_BAKE_TIME, "BAKE_TIME", 0, "Bake_Time", ""}, - {TFM_BEVEL, "BEVEL", 0, "Bevel", ""}, - {TFM_BWEIGHT, "BWEIGHT", 0, "Bweight", ""}, - {TFM_ALIGN, "ALIGN", 0, "Align", ""}, - {TFM_EDGE_SLIDE, "EDGESLIDE", 0, "Edge Slide", ""}, - {TFM_SEQ_SLIDE, "SEQSLIDE", 0, "Sequence Slide", ""}, - {0, NULL, 0, NULL, NULL} - }; - /* identifiers */ ot->name = "Transform"; ot->description= "Transform selected items by mode type"; diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index e1e58572c32..0bda47b4c7c 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -95,6 +95,8 @@ extern EnumPropertyItem operator_context_items[]; extern EnumPropertyItem wm_report_items[]; +extern EnumPropertyItem transform_mode_types[]; + extern EnumPropertyItem property_type_items[]; extern EnumPropertyItem property_unit_items[]; |