diff options
-rw-r--r-- | release/scripts/ui/properties_object.py | 19 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_blender.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 71 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 60 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 13 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 15 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 7 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 21 |
12 files changed, 49 insertions, 170 deletions
diff --git a/release/scripts/ui/properties_object.py b/release/scripts/ui/properties_object.py index 73f0a6fe5c2..5c13d778049 100644 --- a/release/scripts/ui/properties_object.py +++ b/release/scripts/ui/properties_object.py @@ -268,9 +268,10 @@ class OBJECT_PT_duplication(ObjectButtonsPanel): else: layout.prop(ob, "dupli_group", text="") - +# XXX: the following options are all quite buggy, ancient hacks that should be dropped class OBJECT_PT_animation(ObjectButtonsPanel): - bl_label = "Animation" + bl_label = "Animation Hacks" + bl_default_closed = True def draw(self, context): layout = self.layout @@ -293,16 +294,12 @@ class OBJECT_PT_animation(ObjectButtonsPanel): row.prop(ob, "slow_parent") row.active = (ob.parent is not None) col.prop(ob, "time_offset", text="Offset") - - if wide_ui: - col = split.column() - col.label(text="Track:") - col.prop(ob, "track", text="") + + # XXX: these are still used for a few curve-related tracking features + col = split.column() + col.label(text="Tracking Axes:") col.prop(ob, "track_axis", text="Axis") col.prop(ob, "up_axis", text="Up Axis") - row = col.row() - row.prop(ob, "track_override_parent", text="Override Parent") - row.active = (ob.parent is not None) # import generic panels from other files @@ -316,7 +313,7 @@ classes = [ OBJECT_PT_groups, OBJECT_PT_display, OBJECT_PT_duplication, - OBJECT_PT_animation, + OBJECT_PT_animation, # XXX: panel of old hacks pending to be removed... OBJECT_PT_motion_paths, #OBJECT_PT_onion_skinning, diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 6b656f1d12e..8865757b85a 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -45,7 +45,7 @@ struct Scene; struct Main; #define BLENDER_VERSION 252 -#define BLENDER_SUBVERSION 1 +#define BLENDER_SUBVERSION 2 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index afd0b3a0f57..52f59c1681a 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1063,7 +1063,6 @@ void what_does_obaction (Scene *scene, Object *ob, Object *workob, bPose *pose, copy_m4_m4(workob->parentinv, ob->parentinv); copy_m4_m4(workob->constinv, ob->constinv); workob->parent= ob->parent; - workob->track= ob->track; workob->rotmode= ob->rotmode; diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index b2ac32da138..1465f4550f5 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -668,7 +668,7 @@ static void frames_duplilist(ListBase *lb, Scene *scene, Object *ob, int level, if(level>MAX_DUPLI_RECUR) return; cfrao= scene->r.cfra; - if(ob->parent==NULL && ob->track==NULL && ob->ipo==NULL && ob->constraints.first==NULL) return; + if(ob->parent==NULL && ob->constraints.first==NULL) return; if(ob->transflag & OB_DUPLINOSPEED) enable_cu_speed= 0; copyob= *ob; /* store transform info */ diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 3ab5e9442b4..7994849a469 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1867,7 +1867,7 @@ static void samevolume_new_data (void *cdata) data->volume = 1.0f; } -static void samevolume_evaluate (bConstraint *con, bConstraintOb *cob) +static void samevolume_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targets) { bSameVolumeConstraint *data= con->data; @@ -1896,7 +1896,6 @@ static void samevolume_evaluate (bConstraint *con, bConstraintOb *cob) } break; } - } static bConstraintTypeInfo CTI_SAMEVOL = { diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 4e0270315ad..86cafa733ff 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -468,11 +468,6 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O addtoroot = 0; } - if (ob->track) { - node2 = dag_get_node(dag,ob->track); - dag_add_relation(dag,node2,node,DAG_RL_OB_OB, "Track To"); - addtoroot = 0; - } if (ob->proxy) { node2 = dag_get_node(dag, ob->proxy); dag_add_relation(dag, node, node2, DAG_RL_DATA_DATA|DAG_RL_OB_OB, "Proxy"); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 2026bb3da6e..b9e4894a868 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -361,11 +361,6 @@ void unlink_object(Scene *scene, Object *ob) obt->recalc |= OB_RECALC; } - if(obt->track==ob) { - obt->track= NULL; - obt->recalc |= OB_RECALC_OB; - } - modifiers_foreachObjectLink(obt, unlink_object__unlinkModifierLinks, ob); if ELEM(obt->type, OB_CURVE, OB_FONT) { @@ -2037,31 +2032,6 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime) object_to_mat4(ob, ob->obmat); } - /* Handle tracking */ - if(ob->track) { - /* Try to remove this tracking relationship if we can easily detect that - * it is cyclic (i.e. direct tracking), and bound to cause us troubles. - * For the other cases (i.e. a cyclic triangle, and higher orders), we can't - * easily detect or know how to remove those relationships, safely, so just - * let them be (with warnings). - * Of course, this could also be a simple track that doesn't do anything bad either :) - */ - if (ob->track->track == ob) { - printf("Removed direct cyclic tracking between %s and %s\n", ob->id.name+2, ob->track->id.name+2); - ob->track->track = NULL; - ob->track = NULL; - } - else { - /* NOTE: disabled recursive recalc for tracking for now, since this causes crashes - * when users create cyclic dependencies (stack overflow). Really, this step ought - * not to be needed anymore with the depsgraph, though this may not be the case. - * -- Aligorith, 2010 Mar 26 - */ - //if( ctime != ob->track->ctime) where_is_object_time(scene, ob->track, ctime); - solve_tracking(ob, ob->track->obmat); - } - } - /* solve constraints */ if (ob->constraints.first && !(ob->flag & OB_NO_CONSTRAINTS)) { bConstraintOb *cob; @@ -2157,33 +2127,6 @@ static void solve_parenting (Scene *scene, Object *ob, Object *par, float obmat[ } } -void solve_tracking (Object *ob, float targetmat[][4]) -{ - float quat[4]; - float vec[3]; - float totmat[3][3]; - float tmat[4][4]; - - sub_v3_v3v3(vec, ob->obmat[3], targetmat[3]); - vec_to_quat( quat,vec, ob->trackflag, ob->upflag); - quat_to_mat3( totmat,quat); - - if(ob->parent && (ob->transflag & OB_POWERTRACK)) { - /* 'temporal' : clear parent info */ - object_to_mat4(ob, tmat); - tmat[0][3]= ob->obmat[0][3]; - tmat[1][3]= ob->obmat[1][3]; - tmat[2][3]= ob->obmat[2][3]; - tmat[3][0]= ob->obmat[3][0]; - tmat[3][1]= ob->obmat[3][1]; - tmat[3][2]= ob->obmat[3][2]; - tmat[3][3]= ob->obmat[3][3]; - } - else copy_m4_m4(tmat, ob->obmat); - - mul_m4_m3m4(ob->obmat, totmat, tmat); - -} void where_is_object(struct Scene *scene, Object *ob) { @@ -2204,12 +2147,6 @@ for a lamp that is the child of another object */ int a; /* NO TIMEOFFS */ - - /* no ipo! (because of dloc and realtime-ipos) */ - // XXX old animation system - //ipo= ob->ipo; - //ob->ipo= NULL; - if(ob->parent) { par= ob->parent; @@ -2231,9 +2168,6 @@ for a lamp that is the child of another object */ object_to_mat4(ob, ob->obmat); } - if(ob->track) - solve_tracking(ob, ob->track->obmat); - /* solve constraints */ if (ob->constraints.first) { bConstraintOb *cob; @@ -2242,10 +2176,6 @@ for a lamp that is the child of another object */ solve_constraints(&ob->constraints, cob, (float)scene->r.cfra); constraints_clear_evalob(cob); } - - /* WATCH IT!!! */ - // XXX old animation system - //ob->ipo= ipo; } /* for calculation of the inverse parent transform, only used for editor */ @@ -2257,7 +2187,6 @@ void what_does_parent(Scene *scene, Object *ob, Object *workob) unit_m4(workob->parentinv); unit_m4(workob->constinv); workob->parent= ob->parent; - workob->track= ob->track; workob->trackflag= ob->trackflag; workob->upflag= ob->upflag; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index dbdd1685c81..58443a73b96 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6426,6 +6426,25 @@ static void do_version_constraints_radians_degrees_250(ListBase *lb) } } +/* NOTE: this version patch is intended for versions < 2.52.2, but was initially introduced in 2.27 already */ +static void do_version_old_trackto_to_constraints(Object *ob) +{ + /* create new trackto constraint from the relationship */ + if (ob->track) + { + bConstraint *con= add_ob_constraint(ob, "AutoTrack", CONSTRAINT_TYPE_TRACKTO); + bTrackToConstraint *data = con->data; + + /* copy tracking settings from the object */ + data->tar = ob->track; + data->reserved1 = ob->trackflag; + data->reserved2 = ob->upflag; + } + + /* clear old track setting */ + ob->track = NULL; +} + static void do_versions(FileData *fd, Library *lib, Main *main) { /* WATCH IT!!!: pointers from libdata have not been converted */ @@ -7248,36 +7267,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* Change Ob->Track in real TrackTo constraint */ - - if (ob->track){ - bConstraint *con; - bConstraintTypeInfo *cti; - bTrackToConstraint *data; - void *cdata; - - list = &ob->constraints; - if (list) - { - con = MEM_callocN(sizeof(bConstraint), "constraint"); - strcpy (con->name, "AutoTrack"); - unique_constraint_name(con, list); - con->flag |= CONSTRAINT_EXPAND; - con->enforce=1.0F; - con->type = CONSTRAINT_TYPE_TRACKTO; - - cti= get_constraint_typeinfo(CONSTRAINT_TYPE_TRACKTO); - cdata= MEM_callocN(cti->size, cti->structName); - cti->new_data(cdata); - data = (bTrackToConstraint *)cdata; - - data->tar = ob->track; - data->reserved1 = ob->trackflag; - data->reserved2 = ob->upflag; - con->data= (void*) data; - BLI_addtail(list, con); - } - ob->track = 0; - } + do_version_old_trackto_to_constraints(ob); ob = ob->id.next; } @@ -10695,8 +10685,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main) node= node->next; } } - } + + /* old-track -> constraints (this time we're really doing it!) */ + if (main->versionfile < 252 || (main->versionfile == 252 && main->subversionfile < 2)) { + Object *ob; + + for (ob = main->object.first; ob; ob = ob->id.next) + do_version_old_trackto_to_constraints(ob); + } + /* put 2.50 compatibility code here until next subversion bump */ { diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 921a56142d4..a2070771844 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -973,10 +973,6 @@ static void copy_object_set_idnew(bContext *C, int dupflag) { Material *ma, *mao; ID *id; -#if 0 // XXX old animation system - Ipo *ipo; - bActionStrip *strip; -#endif // XXX old animation system int a; /* XXX check object pointers */ @@ -990,17 +986,8 @@ static void copy_object_set_idnew(bContext *C, int dupflag) } modifiers_foreachIDLink(ob, copy_object__forwardModifierLinks, NULL); ID_NEW(ob->parent); - ID_NEW(ob->track); ID_NEW(ob->proxy); ID_NEW(ob->proxy_group); - -#if 0 // XXX old animation system - for(strip= ob->nlastrips.first; strip; strip= strip->next) { - bActionModifier *amod; - for(amod= strip->modifiers.first; amod; amod= amod->next) - ID_NEW(amod->ob); - } -#endif // XXX old animation system } CTX_DATA_END; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index e89bde00ce7..52d6a7a7b8b 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -405,7 +405,7 @@ void OBJECT_OT_proxy_make (wmOperatorType *ot) static EnumPropertyItem prop_clear_parent_types[] = { {0, "CLEAR", 0, "Clear Parent", ""}, - {1, "CLEAR_KEEP_TRANSFORM", 0, "Clear and Keep Transformation (Clear Track)", ""}, + {1, "CLEAR_KEEP_TRANSFORM", 0, "Clear and Keep Transformation", ""}, {2, "CLEAR_INVERSE", 0, "Clear Parent Inverse", ""}, {0, NULL, 0, NULL, NULL} }; @@ -422,7 +422,6 @@ static int parent_clear_exec(bContext *C, wmOperator *op) } else if(type == 1) { ob->parent= NULL; - ob->track= NULL; object_apply_mat4(ob, ob->obmat); } else if(type == 2) @@ -916,7 +915,6 @@ static EnumPropertyItem prop_make_track_types[] = { {1, "DAMPTRACK", 0, "Damped Track Constraint", ""}, {2, "TRACKTO", 0, "Track To Constraint", ""}, {3, "LOCKTRACK", 0, "Lock Track Constraint", ""}, - {4, "OLDTRACK", 0, "Old Track", ""}, {0, NULL, 0, NULL, NULL} }; @@ -988,15 +986,6 @@ static int track_set_exec(bContext *C, wmOperator *op) } CTX_DATA_END; } - else { - CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { - if(ob!=obact) { - ob->track= obact; - ob->recalc |= OB_RECALC; - } - } - CTX_DATA_END; - } DAG_scene_sort(scene); DAG_ids_flush_update(0); @@ -1353,7 +1342,6 @@ void single_object_users(Scene *scene, View3D *v3d, int flag) modifiers_foreachObjectLink(base->object, single_object_users__forwardModifierLinks, NULL); ID_NEW(ob->parent); - ID_NEW(ob->track); } } @@ -1732,7 +1720,6 @@ static int make_local_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN(C, Object*, ob, selected_editable_objects) { if(ob->id.lib==NULL) { ID_NEW(ob->parent); - ID_NEW(ob->track); } } CTX_DATA_END; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 8e8e2aeb5af..eed6c65362c 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4180,10 +4180,7 @@ static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object * if (t->mode == TFM_DUMMY) skip_invert = 1; - if (skip_invert == 0 && (ob->track || constinv==0)) { - track= ob->track; - ob->track= NULL; - + if (skip_invert == 0 && constinv == 0) { if (constinv == 0) ob->transflag |= OB_NO_CONSTRAINTS; /* where_is_object_time checks this */ @@ -4191,8 +4188,6 @@ static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object * if (constinv == 0) ob->transflag &= ~OB_NO_CONSTRAINTS; - - ob->track= track; } else where_is_object(t->scene, ob); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 3823af25619..a3a20376026 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1474,7 +1474,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_float_funcs(prop, "rna_Object_boundbox_get", NULL, NULL); RNA_def_property_ui_text(prop, "Bound Box", "Objects bound box in object-space coords"); - /* parent and track */ + /* parent */ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); @@ -1500,16 +1500,13 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Object_parent_bone_set"); RNA_def_property_ui_text(prop, "Parent Bone", "Name of parent bone in case of a bone parenting relation"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update"); - - prop= RNA_def_property(srna, "track", PROP_POINTER, PROP_NONE); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); - RNA_def_property_ui_text(prop, "Track", "Object being tracked to define the rotation (Old Track)"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update"); - + + /* Track and Up flags */ + // XXX: these have been saved here for a bit longer (after old track was removed), since some other tools still refer to this prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "trackflag"); RNA_def_property_enum_items(prop, track_items); - RNA_def_property_ui_text(prop, "Track Axis", "Tracking axis pointing to the tracked object"); + RNA_def_property_ui_text(prop, "Track Axis", "Axis that points in 'forward' direction"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE); @@ -1517,7 +1514,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_enum_items(prop, up_items); RNA_def_property_ui_text(prop, "Up Axis", "Axis that points in the upward direction"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); - + /* proxy */ prop= RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Proxy", "Library object this proxy object controls"); @@ -1781,11 +1778,7 @@ static void rna_def_object(BlenderRNA *brna) rna_def_motionpath_common(srna); /* duplicates */ - prop= RNA_def_property(srna, "track_override_parent", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "transflag", OB_POWERTRACK); - RNA_def_property_ui_text(prop, "Track Override Parent", "Override rotation from parenting"); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update"); - + // XXX: evil old crap prop= RNA_def_property(srna, "slow_parent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "partype", PARSLOW); RNA_def_property_ui_text(prop, "Slow Parent", "Create a delay in the parent relationship"); |