[Bf-blender-cvs] [7400aa7e595] master: Depsgraph: remove features incompatible with new system.

Brecht Van Lommel noreply at git.blender.org
Thu Jan 31 12:07:19 CET 2019


Commit: 7400aa7e595063510ce9f29fa1b02ebd3f9296e2
Author: Brecht Van Lommel
Date:   Mon Jan 28 17:52:46 2019 +0100
Branches: master
https://developer.blender.org/rB7400aa7e595063510ce9f29fa1b02ebd3f9296e2

Depsgraph: remove features incompatible with new system.

Some features are incompatible with multithreading and reliable evaluation
of dependencies. We are now removing them as part of a bigger cleanup to
fix bugs in keyframing and invalid animation evaluations.

* Dupliframes have been removed. This was a hack added before there were
  more powerful features like the array modifier.
* Slow parent has been removed, never worked in 2.8. It was always
  unreliable for use in production due to depending on whatever frame was
  previously evaluated, which was not always the previous frame.
* Particle instanced objects used to have their transform evaluated at
  the particle time. Now it always gets the current time transform.
* Boids can no longer do predictive avoidance of force field objects,
  but still for other particles.

Differential Revision: https://developer.blender.org/D4274

===================================================================

M	release/scripts/startup/bl_ui/properties_object.py
M	source/blender/blenkernel/BKE_effect.h
M	source/blender/blenkernel/BKE_object.h
M	source/blender/blenkernel/intern/effect.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/object_dupli.c
M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/depsgraph/intern/depsgraph_query_iter.cc
M	source/blender/editors/object/object_intern.h
M	source/blender/editors/object/object_ops.c
M	source/blender/editors/object/object_relations.c
M	source/blender/editors/space_info/info_stats.c
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/render/intern/source/pipeline.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 1cf8c75adad..3f1ea64bf30 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -149,13 +149,6 @@ class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
             sub.prop_search(ob, "parent_bone", parent.data, "bones")
         sub.active = (parent is not None)
 
-        col = flow.column()
-        col.active = (ob.parent is not None)
-        col.prop(ob, "use_slow_parent")
-        sub = col.column()
-        sub.active = (ob.use_slow_parent)
-        sub.prop(ob, "slow_parent_offset", text="Offset")
-
         col.separator()
 
         col = flow.column()
@@ -295,20 +288,7 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
         layout.use_property_split = True
         flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
 
-        if ob.instance_type == 'FRAMES':
-
-            col = flow.column(align=True)
-            col.prop(ob, "instance_frames_start", text="Start")
-            col.prop(ob, "instance_frames_end", text="End")
-
-            col = flow.column(align=True)
-            col.prop(ob, "instance_frames_on", text="On")
-            col.prop(ob, "instance_frames_off", text="Off")
-
-            col = flow.column(align=True)
-            col.prop(ob, "use_instance_frames_speed", text="Speed")
-
-        elif ob.instance_type == 'VERTS':
+        if ob.instance_type == 'VERTS':
             layout.prop(ob, "use_instance_vertices_rotation", text="Rotation")
 
         elif ob.instance_type == 'FACES':
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h
index 845c6846708..59284bfadb3 100644
--- a/source/blender/blenkernel/BKE_effect.h
+++ b/source/blender/blenkernel/BKE_effect.h
@@ -105,7 +105,6 @@ typedef struct EffectorCache {
 	/* precalculated for guides */
 	struct GuideEffectorData *guide_data;
 	float guide_loc[4], guide_dir[3], guide_radius;
-	float velocity[3];
 
 	float frame;
 	int flag;
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 76647817b88..c7d34480a20 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -159,8 +159,6 @@ struct Base **BKE_object_pose_base_array_get(struct ViewLayer *view_layer, struc
 
 void BKE_object_get_parent_matrix(
         struct Object *ob, struct Object *par, float parentmat[4][4]);
-void BKE_object_get_parent_matrix_for_dupli(
-        struct Object *ob, struct Object *par, float dupli_ctime, int dupli_transflag, float parentmat[4][4]);
 void BKE_object_where_is_calc(
         struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob);
 void BKE_object_where_is_calc_ex(
@@ -168,10 +166,8 @@ void BKE_object_where_is_calc_ex(
         struct Object *ob, float r_originmat[3][3]);
 void BKE_object_where_is_calc_time(
         struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, float ctime);
-void BKE_object_where_is_calc_time_for_dupli(
-        struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, float ctime, int dupli_transflag);
 void BKE_object_where_is_calc_time_ex(
-        struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, float ctime, int dupli_transflag,
+        struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob, float ctime,
         struct RigidBodyWorld *rbw, float r_originmat[3][3]);
 void BKE_object_where_is_calc_mat4(struct Object *ob, float obmat[4][4]);
 
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index 453d1e70309..e98de4c92f3 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -183,16 +183,6 @@ static void precalculate_effector(struct Depsgraph *depsgraph, EffectorCache *ef
 	}
 	else if (eff->psys)
 		psys_update_particle_tree(eff->psys, ctime);
-
-	/* Store object velocity */
-	if (eff->ob) {
-		float old_vel[3];
-
-		BKE_object_where_is_calc_time(depsgraph, eff->scene, eff->ob, cfra - 1.0f);
-		copy_v3_v3(old_vel, eff->ob->obmat[3]);
-		BKE_object_where_is_calc_time(depsgraph, eff->scene, eff->ob, cfra);
-		sub_v3_v3v3(eff->velocity, eff->ob->obmat[3], old_vel);
-	}
 }
 
 static void add_effector_relation(ListBase *relations, Object *ob, ParticleSystem *psys, PartDeflect *pd)
@@ -690,9 +680,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin
 			copy_v3_v3(efd->loc, ob->obmat[3]);
 		}
 
-		if (real_velocity) {
-			copy_v3_v3(efd->vel, eff->velocity);
-		}
+		zero_v3(efd->vel);
 		efd->size = 0.0f;
 
 		ret = 1;
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 4e1ba003228..341a15268ef 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -857,8 +857,6 @@ void BKE_object_init(Object *ob)
 		ob->upflag = OB_POSZ;
 	}
 
-	ob->dupon = 1; ob->dupoff = 0;
-	ob->dupsta = 1; ob->dupend = 100;
 	ob->dupfacesca = 1.0;
 
 	ob->col_group = 0x01;
@@ -1915,8 +1913,7 @@ void BKE_object_matrix_local_get(struct Object *ob, float mat[4][4])
  * \param depsgraph: Used for dupli-frame time.
  * \return success if \a mat is set.
  */
-static bool ob_parcurve(Object *ob, Object *par,
-                        float dupli_ctime, int dupli_transflag, float mat[4][4])
+static bool ob_parcurve(Object *ob, Object *par, float mat[4][4])
 {
 	Curve *cu = par->data;
 	float vec[4], dir[3], quat[4], radius, ctime;
@@ -1936,29 +1933,19 @@ static bool ob_parcurve(Object *ob, Object *par,
 		return false;
 	}
 
-	/* catch exceptions: curve paths used as a duplicator */
-	if ((dupli_transflag & OB_DUPLINOSPEED) == 0) {
-		/* ctime is now a proper var setting of Curve which gets set by Animato like any other var that's animated,
-		 * but this will only work if it actually is animated...
-		 *
-		 * we divide the curvetime calculated in the previous step by the length of the path, to get a time
-		 * factor, which then gets clamped to lie within 0.0 - 1.0 range
-		 */
-		if (cu->pathlen) {
-			ctime = cu->ctime / cu->pathlen;
-		}
-		else {
-			ctime = cu->ctime;
-		}
-		CLAMP(ctime, 0.0f, 1.0f);
+	/* ctime is now a proper var setting of Curve which gets set by Animato like any other var that's animated,
+	 * but this will only work if it actually is animated...
+	 *
+	 * we divide the curvetime calculated in the previous step by the length of the path, to get a time
+	 * factor, which then gets clamped to lie within 0.0 - 1.0 range
+	 */
+	if (cu->pathlen) {
+		ctime = cu->ctime / cu->pathlen;
 	}
 	else {
-		ctime = dupli_ctime;
-		if (cu->pathlen) {
-			ctime /= cu->pathlen;
-		}
-		CLAMP(ctime, 0.0f, 1.0f);
+		ctime = cu->ctime;
 	}
+	CLAMP(ctime, 0.0f, 1.0f);
 
 	unit_m4(mat);
 
@@ -2145,9 +2132,7 @@ static void ob_parvert3(Object *ob, Object *par, float mat[4][4])
 	}
 }
 
-void BKE_object_get_parent_matrix_for_dupli(Object *ob, Object *par,
-                                            float dupli_ctime, int dupli_transflag,
-                                            float parentmat[4][4])
+void BKE_object_get_parent_matrix(Object *ob, Object *par, float parentmat[4][4])
 {
 	float tmat[4][4];
 	float vec[3];
@@ -2158,7 +2143,7 @@ void BKE_object_get_parent_matrix_for_dupli(Object *ob, Object *par,
 			ok = 0;
 			if (par->type == OB_CURVE) {
 				if ((((Curve *)par->data)->flag & CU_PATH) &&
-				    (ob_parcurve(ob, par, dupli_ctime, dupli_transflag, tmat)))
+				    (ob_parcurve(ob, par, tmat)))
 				{
 					ok = 1;
 				}
@@ -2188,20 +2173,13 @@ void BKE_object_get_parent_matrix_for_dupli(Object *ob, Object *par,
 			copy_m4_m4(parentmat, par->obmat);
 			break;
 	}
-
-}
-
-void BKE_object_get_parent_matrix(Object *ob, Object *par, float parentmat[4][4])
-{
-	BKE_object_get_parent_matrix_for_dupli(ob, par, 0, 0, parentmat);
 }
 
 /**
  * \param r_originmat: Optional matrix that stores the space the object is in (without its own matrix applied)
  */
-static void solve_parenting(Object *ob, Object *par, float obmat[4][4], float slowmat[4][4],
-                            float r_originmat[3][3], const bool set_origin,
-                            float dupli_ctime, int dupli_transflag)
+static void solve_parenting(Object *ob, Object *par, float obmat[4][4],
+                            float r_originmat[3][3], const bool set_origin)
 {
 	float totmat[4][4];
 	float tmat[4][4];
@@ -2209,9 +2187,7 @@ static void solve_parenting(Object *ob, Object *par, float obmat[4][4], float sl
 
 	BKE_object_to_mat4(ob, locmat);
 
-	if (ob->partype & PARSLOW) copy_m4_m4(slowmat, obmat);
-
-	BKE_object_get_parent_matrix_for_dupli(ob, par, dupli_ctime, dupli_transflag, totmat);
+	BKE_object_get_parent_matrix(ob, par, totmat);
 
 	/* total */
 	mul_m4_m4m4(tmat, totmat, ob->parentinv);
@@ -2233,29 +2209,9 @@ static void solve_parenting(Object *ob, Object *par, float obmat[4][4], float sl
 	}
 }
 
-static bool where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[4][4])
-{
-	float *fp1, *fp2;
-	float fac1, fac2;
-	int a;
-
-	/* include framerate */
-	fac1 = (1.0f / (1.0f + fabsf(ob->sf)));
-	if (fac1 >= 1.0f) return false;
-	fac2 = 1.0f - fac1;
-
-	fp1 = obmat[0];
-	fp2 = slowmat[0];
-	for (a = 0; a < 16; a++, fp1++, fp2++) {
-		fp1[0] = fac1 * fp1[0] + fac2 * fp2[0];
-	}
-
-	return true;
-}
-
 /* note, scene is the active scene while actual_scene is the scene the object resides in */
 void BKE_object_where_is_calc_time_ex(
-        Depsgraph *depsgraph, Scene *scene, Object *ob, float ctime, int dupli_transflag,
+        Depsgraph *depsgraph, Scene *scene, Object *ob, float ctime,
         RigidBodyWorld *rbw, float r_originmat[3][3])
 {
 	if (ob == NULL) return;
@@ -2265,19 +2221,9 @@ void BKE_object_where_is_calc_time_ex(
 
 	if (ob->parent) {
 		Object *par = ob->parent;
-		float slowmat[4][4];
 
 		/* calculate parent matrix */
-		solve_parenting(ob, par, ob->obmat, slowmat, r_originmat, true,
-		                ctime, dupli_transflag);
-
-		/* "slow parent" is definitely not threads

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list