[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41573] trunk/blender: As discussed on the mailing list, removing the non-functional,

Joshua Leung aligorith at gmail.com
Sun Nov 6 06:46:46 CET 2011


Revision: 41573
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41573
Author:   aligorith
Date:     2011-11-06 05:46:45 +0000 (Sun, 06 Nov 2011)
Log Message:
-----------
As discussed on the mailing list, removing the non-functional,
incompatible, and unmaintainable Time Offset cruft.

- Slow Parenting lives another day (just), although it now carries
appropriate cautionary disclaimers. It's only really for the Game
Engine nowadays, as that's the only place where it can possibly work
with any reliability.
- "Animation Hacks" panel is now "Relations Extras". I could've merged
the two panels, though I figured these options weren't that frequently
used to justify taking up screen-space by default along with the panel

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/properties_object.py
    trunk/blender/source/blender/blenkernel/BKE_object.h
    trunk/blender/source/blender/blenkernel/intern/group.c
    trunk/blender/source/blender/blenkernel/intern/object.c
    trunk/blender/source/blender/blenkernel/intern/pointcache.c
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/animation/anim_draw.c
    trunk/blender/source/blender/editors/animation/keyframing.c
    trunk/blender/source/blender/editors/include/ED_anim_api.h
    trunk/blender/source/blender/editors/object/object_relations.c
    trunk/blender/source/blender/editors/space_view3d/drawobject.c
    trunk/blender/source/blender/makesdna/DNA_object_types.h
    trunk/blender/source/blender/makesrna/intern/rna_object.c

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_object.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_object.py	2011-11-06 01:39:36 UTC (rev 41572)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_object.py	2011-11-06 05:46:45 UTC (rev 41573)
@@ -257,10 +257,8 @@
             layout.prop(ob, "dupli_group", text="Group")
 
 
-# XXX: the following options are all quite buggy, ancient hacks that should be dropped
-
-class OBJECT_PT_animation(ObjectButtonsPanel, Panel):
-    bl_label = "Animation Hacks"
+class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel):
+    bl_label = "Relations Extras"
     bl_options = {'DEFAULT_CLOSED'}
 
     def draw(self, context):
@@ -269,23 +267,17 @@
         ob = context.object
 
         split = layout.split()
-
+        
         col = split.column()
-        col.label(text="Time Offset:")
-        col.prop(ob, "use_time_offset_edit", text="Edit")
-        row = col.row()
-        row.prop(ob, "use_time_offset_parent", text="Parent")
-        row.active = (ob.parent is not None)
-        row = col.row()
-        row.prop(ob, "use_slow_parent")
-        row.active = (ob.parent is not None)
-        col.prop(ob, "time_offset", text="Offset")
-
-        # 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")
+        
+        col = split.column()
+        col.prop(ob, "use_slow_parent")
+        row = col.row()
+        row.active = ((ob.parent is not None) and (ob.use_slow_parent))
+        row.prop(ob, "slow_parent_offset", text="Offset")
 
 
 from bl_ui.properties_animviz import (

Modified: trunk/blender/source/blender/blenkernel/BKE_object.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_object.h	2011-11-06 01:39:36 UTC (rev 41572)
+++ trunk/blender/source/blender/blenkernel/BKE_object.h	2011-11-06 05:46:45 UTC (rev 41573)
@@ -86,7 +86,7 @@
 void set_field_offs(float field);
 void disable_speed_curve(int val);
 
-float bsystem_time(struct Scene *scene, struct Object *ob, float cfra, float ofs);
+float bsystem_time(struct Scene *scene, struct Object *ob, float cfra, float ofs); // XXX: last arg unused?
 void object_scale_to_mat3(struct Object *ob, float mat[][3]);
 void object_rot_to_mat3(struct Object *ob, float mat[][3]);
 void object_mat3_to_rot(struct Object *ob, float mat[][3], short use_compat);
@@ -118,7 +118,6 @@
 void object_handle_update(struct Scene *scene, struct Object *ob);
 void object_sculpt_modifiers_changed(struct Object *ob);
 
-float give_timeoffset(struct Object *ob);
 int give_obdata_texspace(struct Object *ob, short **texflag, float **loc, float **size, float **rot);
 
 int object_insert_ptcache(struct Object *ob);

Modified: trunk/blender/source/blender/blenkernel/intern/group.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/group.c	2011-11-06 01:39:36 UTC (rev 41572)
+++ trunk/blender/source/blender/blenkernel/intern/group.c	2011-11-06 05:46:45 UTC (rev 41573)
@@ -276,8 +276,9 @@
 int group_is_animated(Object *parent, Group *group)
 {
 	GroupObject *go;
-
-	if(give_timeoffset(parent) != 0.0f || parent->nlastrips.first)
+	
+	// XXX: old animsys depreceated...
+	if(parent->nlastrips.first)
 		return 1;
 
 	for(go= group->gobject.first; go; go= go->next)
@@ -343,12 +344,11 @@
 	   * but when its enabled at some point it will need to be changed so as not to update so much - campbell */
 
 	/* if animated group... */
-	if(give_timeoffset(parent) != 0.0f || parent->nlastrips.first) {
+	if(parent->nlastrips.first) {
 		int cfrao;
 		
 		/* switch to local time */
 		cfrao= scene->r.cfra;
-		scene->r.cfra -= (int)floor(give_timeoffset(parent) + 0.5f);
 		
 		/* we need a DAG per group... */
 		for(go= group->gobject.first; go; go= go->next) {

Modified: trunk/blender/source/blender/blenkernel/intern/object.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/object.c	2011-11-06 01:39:36 UTC (rev 41572)
+++ trunk/blender/source/blender/blenkernel/intern/object.c	2011-11-06 05:46:45 UTC (rev 41573)
@@ -1431,16 +1431,8 @@
 	
 	/* global time */
 	if (scene)
-		cfra*= scene->r.framelen;	
+		cfra *= scene->r.framelen;	
 	
-#if 0 // XXX old animation system
-	if (ob) {
-		/* ofset frames */
-		if ((ob->ipoflag & OB_OFFS_PARENT) && (ob->partype & PARSLOW)==0) 
-			cfra-= give_timeoffset(ob);
-	}
-#endif // XXX old animation system
-	
 	cfra-= ofs;
 
 	return cfra;
@@ -1592,12 +1584,6 @@
 		makeDispListCurveTypes(scene, par, 0);
 	if(cu->path==NULL) return;
 	
-	/* exception, timeoffset is regarded as distance offset */
-	if(cu->flag & CU_OFFS_PATHDIST) {
-		timeoffs = give_timeoffset(ob);
-		SWAP(float, sf_orig, ob->sf);
-	}
-	
 	/* catch exceptions: feature for nla stride editing */
 	if(ob->ipoflag & OB_DISABLE_PATH) {
 		ctime= 0.0f;
@@ -1618,7 +1604,7 @@
 		CLAMP(ctime, 0.0f, 1.0f);
 	}
 	else {
-		ctime= scene->r.cfra - give_timeoffset(ob);
+		ctime= scene->r.cfra;
 		if (IS_EQF(cu->pathlen, 0.0f) == 0)
 			ctime /= cu->pathlen;
 		
@@ -1862,9 +1848,6 @@
 	if(ob->parent) {
 		Object *par= ob->parent;
 		
-		// XXX depreceated - animsys
-		if(ob->ipoflag & OB_OFFS_PARENT) ctime-= give_timeoffset(ob);
-		
 		/* hurms, code below conflicts with depgraph... (ton) */
 		/* and even worse, it gives bad effects for NLA stride too (try ctime != par->ctime, with MBlur) */
 		if(no_parent_ipo==0 && stime != par->ctime) {
@@ -1873,17 +1856,20 @@
 			
 			if(par->proxy_from);	// was a copied matrix, no where_is! bad...
 			else where_is_object_time(scene, par, ctime);
-
+			
 			solve_parenting(scene, ob, par, ob->obmat, slowmat, 0);
-
+			
 			*par= tmp;
 		}
 		else
 			solve_parenting(scene, ob, par, ob->obmat, slowmat, 0);
 		
+		/* "slow parent" is definitely not threadsafe, and may also give bad results jumping around 
+		 * An old-fashioned hack which probably doesn't really cut it anymore
+		 */
 		if(ob->partype & PARSLOW) {
 			// include framerate
-			fac1= ( 1.0f / (1.0f + (float)fabs(give_timeoffset(ob))) );
+			fac1= ( 1.0f / (1.0f + (float)fabs(ob->sf)) );
 			if(fac1 >= 1.0f) return;
 			fac2= 1.0f-fac1;
 			
@@ -2006,7 +1992,6 @@
 for a lamp that is the child of another object */
 {
 	Object *par;
-	//Ipo *ipo;
 	float *fp1, *fp2;
 	float slowmat[4][4];
 	float fac1, fac2;
@@ -2017,10 +2002,9 @@
 		par= ob->parent;
 		
 		solve_parenting(scene, ob, par, ob->obmat, slowmat, 1);
-
+		
 		if(ob->partype & PARSLOW) {
-
-			fac1= (float)(1.0/(1.0+ fabs(give_timeoffset(ob))));
+			fac1= (float)(1.0/(1.0+ fabs(ob->sf)));
 			fac2= 1.0f-fac1;
 			fp1= ob->obmat[0];
 			fp2= slowmat[0];
@@ -2028,7 +2012,6 @@
 				fp1[0]= fac1*fp1[0] + fac2*fp2[0];
 			}
 		}
-		
 	}
 	else {
 		object_to_mat4(ob, ob->obmat);
@@ -2554,15 +2537,6 @@
 	}
 }
 
-float give_timeoffset(Object *ob)
-{
-	if ((ob->ipoflag & OB_OFFS_PARENTADD) && ob->parent) {
-		return ob->sf + give_timeoffset(ob->parent);
-	} else {
-		return ob->sf;
-	}
-}
-
 int give_obdata_texspace(Object *ob, short **texflag, float **loc, float **size, float **rot)
 {
 	

Modified: trunk/blender/source/blender/blenkernel/intern/pointcache.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/pointcache.c	2011-11-06 01:39:36 UTC (rev 41572)
+++ trunk/blender/source/blender/blenkernel/intern/pointcache.c	2011-11-06 05:46:45 UTC (rev 41573)
@@ -2163,7 +2163,7 @@
 		 * system timing. */
 #if 0
 		if ((ob->partype & PARSLOW)==0) {
-			offset= give_timeoffset(ob);
+			offset= ob->sf;
 
 			*startframe += (int)(offset+0.5f);
 			*endframe += (int)(offset+0.5f);

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2011-11-06 01:39:36 UTC (rev 41572)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2011-11-06 05:46:45 UTC (rev 41573)
@@ -7155,7 +7155,7 @@
 		while(ob) {
 			if(ob->transflag & 1) {
 				ob->transflag -= 1;
-				ob->ipoflag |= OB_OFFS_OB;
+				//ob->ipoflag |= OB_OFFS_OB;
 			}
 			ob= ob->id.next;
 		}
@@ -7186,7 +7186,7 @@
 		}
 		ob= main->object.first;
 		while(ob) {
-			ob->ipoflag |= OB_OFFS_PARENT;
+			//ob->ipoflag |= OB_OFFS_PARENT;
 			if(ob->dt==0) ob->dt= OB_SOLID;
 			ob= ob->id.next;
 		}

Modified: trunk/blender/source/blender/editors/animation/anim_draw.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_draw.c	2011-11-06 01:39:36 UTC (rev 41572)
+++ trunk/blender/source/blender/editors/animation/anim_draw.c	2011-11-06 05:46:45 UTC (rev 41573)
@@ -237,28 +237,6 @@
 		glVertex2fv(vec);
 	glEnd();
 	
-	/* Draw dark green line if slow-parenting/time-offset is enabled */
-	if (flag & DRAWCFRA_SHOW_TIMEOFS) {
-		Object *ob= OBACT;
-		if(ob) {
-			float timeoffset= give_timeoffset(ob);
-			// XXX ob->ipoflag is depreceated!
-			if ((ob->ipoflag & OB_OFFS_OB) && (timeoffset != 0.0f)) {
-				vec[0]-= timeoffset; /* could avoid calling twice */
-				
-				UI_ThemeColorShade(TH_CFRAME, -30);
-				
-				glBegin(GL_LINE_STRIP);
-					/*vec[1]= v2d->cur.ymax;*/ // this is set already. this line is only included
-					glVertex2fv(vec);
-					
-					vec[1]= v2d->cur.ymin;
-					glVertex2fv(vec);
-				glEnd();
-			}
-		}
-	}
-	
 	glLineWidth(1.0);
 	
 	/* Draw current frame number in a little box */

Modified: trunk/blender/source/blender/editors/animation/keyframing.c
===================================================================
--- trunk/blender/source/blender/editors/animation/keyframing.c	2011-11-06 01:39:36 UTC (rev 41572)
+++ trunk/blender/source/blender/editors/animation/keyframing.c	2011-11-06 05:46:45 UTC (rev 41573)
@@ -911,20 +911,6 @@
 		/* apply NLA-mapping to frame to use (if applicable) */
 		cfra= BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP);
 	}
-
-#if 0
-	/* apply special time tweaking */
-		// XXX check on this stuff...
-	if (GS(id->name) == ID_OB) {
-		//Object *ob= (Object *)id;
-		
-		/* ancient time-offset cruft */
-		//if ( (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)) ) {

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list