forked from bartvdbraak/blender
changes needed for EDL import to work again.
- add sequence.update(data=False) function. - made some sequence vars editable. - correct some comments. also rename rna function sequence.getStripElem() --> strip_elem_from_frame()
This commit is contained in:
parent
c0e1f23e5a
commit
ea2224e28d
@ -26,7 +26,6 @@ __all__ = (
|
|||||||
|
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
import mathutils
|
|
||||||
|
|
||||||
from bpy.props import BoolProperty, FloatVectorProperty
|
from bpy.props import BoolProperty, FloatVectorProperty
|
||||||
|
|
||||||
@ -80,7 +79,7 @@ def add_object_align_init(context, operator):
|
|||||||
rotation = space_data.region_3d.view_matrix.to_3x3().inverted()
|
rotation = space_data.region_3d.view_matrix.to_3x3().inverted()
|
||||||
rotation.resize_4x4()
|
rotation.resize_4x4()
|
||||||
else:
|
else:
|
||||||
rotation = mathutils.Matrix()
|
rotation = Matrix()
|
||||||
|
|
||||||
# set the operator properties
|
# set the operator properties
|
||||||
if operator:
|
if operator:
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
# <pep8-80 compliant>
|
# <pep8-80 compliant>
|
||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Operator
|
from bpy.types import Operator
|
||||||
import mathutils
|
|
||||||
|
|
||||||
from bpy.props import (FloatProperty,
|
from bpy.props import (FloatProperty,
|
||||||
IntProperty,
|
IntProperty,
|
||||||
@ -31,9 +30,7 @@ from bpy_extras import object_utils
|
|||||||
|
|
||||||
def add_torus(major_rad, minor_rad, major_seg, minor_seg):
|
def add_torus(major_rad, minor_rad, major_seg, minor_seg):
|
||||||
from math import cos, sin, pi
|
from math import cos, sin, pi
|
||||||
|
from mathutils import Vector, Quaternion
|
||||||
Vector = mathutils.Vector
|
|
||||||
Quaternion = mathutils.Quaternion
|
|
||||||
|
|
||||||
PI_2 = pi * 2.0
|
PI_2 = pi * 2.0
|
||||||
z_axis = 0.0, 0.0, 1.0
|
z_axis = 0.0, 0.0, 1.0
|
||||||
|
@ -433,7 +433,7 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
|
|||||||
elem = False
|
elem = False
|
||||||
|
|
||||||
if strip.type == 'IMAGE':
|
if strip.type == 'IMAGE':
|
||||||
elem = strip.getStripElem(frame_current)
|
elem = strip.strip_elem_from_frame(frame_current)
|
||||||
elif strip.type == 'MOVIE':
|
elif strip.type == 'MOVIE':
|
||||||
elem = strip.elements[0]
|
elem = strip.elements[0]
|
||||||
|
|
||||||
@ -595,7 +595,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel, Panel):
|
|||||||
|
|
||||||
# Current element for the filename
|
# Current element for the filename
|
||||||
|
|
||||||
elem = strip.getStripElem(context.scene.frame_current)
|
elem = strip.strip_elem_from_frame(context.scene.frame_current)
|
||||||
if elem:
|
if elem:
|
||||||
split = layout.split(percentage=0.2)
|
split = layout.split(percentage=0.2)
|
||||||
split.label(text="File:")
|
split.label(text="File:")
|
||||||
|
@ -633,7 +633,7 @@ void BKE_sequence_calc(Scene *scene, Sequence *seq)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* note: caller should run calc_sequence(scene, seq) after */
|
/* note: caller should run BKE_sequence_calc(scene, seq) after */
|
||||||
void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, int lock_range)
|
void BKE_sequence_reload_new_file(Scene *scene, Sequence *seq, int lock_range)
|
||||||
{
|
{
|
||||||
char str[FILE_MAX];
|
char str[FILE_MAX];
|
||||||
|
@ -871,7 +871,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
|
|||||||
if (BKE_sequence_test_overlap(ed->seqbasep, seq)) BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
|
if (BKE_sequence_test_overlap(ed->seqbasep, seq)) BKE_sequence_base_shuffle(ed->seqbasep, seq, scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
BKE_sequencer_update_changed_seq_and_deps(scene, seq, 1, 1); /* runs calc_sequence */
|
BKE_sequencer_update_changed_seq_and_deps(scene, seq, 1, 1); /* runs BKE_sequence_calc */
|
||||||
|
|
||||||
|
|
||||||
/* not sure if this is needed with update_changed_seq_and_deps.
|
/* not sure if this is needed with update_changed_seq_and_deps.
|
||||||
|
@ -4090,7 +4090,7 @@ static void SeqTransInfo(TransInfo *t, Sequence *seq, int *recursive, int *count
|
|||||||
/* Meta's can only directly be moved between channels since they
|
/* Meta's can only directly be moved between channels since they
|
||||||
* don't have their start and length set directly (children affect that)
|
* don't have their start and length set directly (children affect that)
|
||||||
* since this Meta is nested we don't need any of its data in fact.
|
* since this Meta is nested we don't need any of its data in fact.
|
||||||
* calc_sequence() will update its settings when run on the toplevel meta */
|
* BKE_sequence_calc() will update its settings when run on the toplevel meta */
|
||||||
*flag = 0;
|
*flag = 0;
|
||||||
*count = 0;
|
*count = 0;
|
||||||
*recursive = TRUE;
|
*recursive = TRUE;
|
||||||
|
@ -1401,26 +1401,26 @@ static void rna_def_sequence(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop = RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME);
|
prop = RNA_def_property(srna, "frame_offset_start", PROP_INT, PROP_TIME);
|
||||||
RNA_def_property_int_sdna(prop, NULL, "startofs");
|
RNA_def_property_int_sdna(prop, NULL, "startofs");
|
||||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
|
// RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
|
||||||
RNA_def_property_ui_text(prop, "Start Offset", "");
|
RNA_def_property_ui_text(prop, "Start Offset", "");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "frame_offset_end", PROP_INT, PROP_TIME);
|
prop = RNA_def_property(srna, "frame_offset_end", PROP_INT, PROP_TIME);
|
||||||
RNA_def_property_int_sdna(prop, NULL, "endofs");
|
RNA_def_property_int_sdna(prop, NULL, "endofs");
|
||||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
|
// RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
|
||||||
RNA_def_property_ui_text(prop, "End Offset", "");
|
RNA_def_property_ui_text(prop, "End Offset", "");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME);
|
prop = RNA_def_property(srna, "frame_still_start", PROP_INT, PROP_TIME);
|
||||||
RNA_def_property_int_sdna(prop, NULL, "startstill");
|
RNA_def_property_int_sdna(prop, NULL, "startstill");
|
||||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
|
// RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
|
||||||
RNA_def_property_range(prop, 0, MAXFRAME);
|
RNA_def_property_range(prop, 0, MAXFRAME);
|
||||||
RNA_def_property_ui_text(prop, "Start Still", "");
|
RNA_def_property_ui_text(prop, "Start Still", "");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "frame_still_end", PROP_INT, PROP_TIME);
|
prop = RNA_def_property(srna, "frame_still_end", PROP_INT, PROP_TIME);
|
||||||
RNA_def_property_int_sdna(prop, NULL, "endstill");
|
RNA_def_property_int_sdna(prop, NULL, "endstill");
|
||||||
RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
|
// RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* overlap tests */
|
||||||
RNA_def_property_range(prop, 0, MAXFRAME);
|
RNA_def_property_range(prop, 0, MAXFRAME);
|
||||||
RNA_def_property_ui_text(prop, "End Still", "");
|
RNA_def_property_ui_text(prop, "End Still", "");
|
||||||
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
|
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
#include "DNA_scene_types.h"
|
#include "DNA_scene_types.h"
|
||||||
#include "DNA_sequence_types.h"
|
#include "DNA_sequence_types.h"
|
||||||
|
|
||||||
|
#include "BLI_utildefines.h"
|
||||||
|
|
||||||
#ifdef RNA_RUNTIME
|
#ifdef RNA_RUNTIME
|
||||||
|
|
||||||
//#include "DNA_anim_types.h"
|
//#include "DNA_anim_types.h"
|
||||||
@ -62,6 +64,16 @@
|
|||||||
|
|
||||||
#include "WM_api.h"
|
#include "WM_api.h"
|
||||||
|
|
||||||
|
static void rna_Sequence_update_rnafunc(ID *id, Sequence *self, int do_data)
|
||||||
|
{
|
||||||
|
if (do_data) {
|
||||||
|
BKE_sequencer_update_changed_seq_and_deps((Scene *)id, self, true, true);
|
||||||
|
// new_tstripdata(self); // need 2.6x version of this.
|
||||||
|
}
|
||||||
|
BKE_sequence_calc((Scene *)id, self);
|
||||||
|
BKE_sequence_calc_disp((Scene *)id, self);
|
||||||
|
}
|
||||||
|
|
||||||
static void rna_Sequence_swap_internal(Sequence *seq_self, ReportList *reports, Sequence *seq_other)
|
static void rna_Sequence_swap_internal(Sequence *seq_self, ReportList *reports, Sequence *seq_other)
|
||||||
{
|
{
|
||||||
const char *error_msg;
|
const char *error_msg;
|
||||||
@ -389,7 +401,13 @@ void RNA_api_sequence_strip(StructRNA *srna)
|
|||||||
FunctionRNA *func;
|
FunctionRNA *func;
|
||||||
PropertyRNA *parm;
|
PropertyRNA *parm;
|
||||||
|
|
||||||
func = RNA_def_function(srna, "getStripElem", "BKE_sequencer_give_stripelem");
|
func = RNA_def_function(srna, "update", "rna_Sequence_update_rnafunc");
|
||||||
|
RNA_def_function_flag(func, FUNC_USE_SELF_ID);
|
||||||
|
RNA_def_function_ui_description(func, "Update the strip dimensions");
|
||||||
|
parm = RNA_def_boolean(func, "data", false, "Frame",
|
||||||
|
"Update strip data");
|
||||||
|
|
||||||
|
func = RNA_def_function(srna, "strip_elem_from_frame", "BKE_sequencer_give_stripelem");
|
||||||
RNA_def_function_ui_description(func, "Return the strip element from a given frame or None");
|
RNA_def_function_ui_description(func, "Return the strip element from a given frame or None");
|
||||||
parm = RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame",
|
parm = RNA_def_int(func, "frame", 0, -MAXFRAME, MAXFRAME, "Frame",
|
||||||
"The frame to get the strip element from", -MAXFRAME, MAXFRAME);
|
"The frame to get the strip element from", -MAXFRAME, MAXFRAME);
|
||||||
|
@ -818,7 +818,7 @@ typedef struct {
|
|||||||
} dealloc_obj;
|
} dealloc_obj;
|
||||||
|
|
||||||
/* call once __file__ is set */
|
/* call once __file__ is set */
|
||||||
void bpy_module_delay_init(PyObject *bpy_proxy)
|
static void bpy_module_delay_init(PyObject *bpy_proxy)
|
||||||
{
|
{
|
||||||
const int argc = 1;
|
const int argc = 1;
|
||||||
const char *argv[2];
|
const char *argv[2];
|
||||||
@ -856,6 +856,9 @@ static void dealloc_obj_dealloc(PyObject *self)
|
|||||||
dealloc_obj_Type.tp_free(self);
|
dealloc_obj_Type.tp_free(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PyMODINIT_FUNC
|
||||||
|
PyInit_bpy(void);
|
||||||
|
|
||||||
PyMODINIT_FUNC
|
PyMODINIT_FUNC
|
||||||
PyInit_bpy(void)
|
PyInit_bpy(void)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user