Duplicator bugfix: particle duplicators were not restoring the matrix for
authorTon Roosendaal <ton@blender.org>
Thu, 2 Feb 2006 19:54:42 +0000 (19:54 +0000)
committerTon Roosendaal <ton@blender.org>
Thu, 2 Feb 2006 19:54:42 +0000 (19:54 +0000)
the duplicated object correctly. This appeared like object disappeared.

Note; to see this fix work on older files, you have to invoke a depsgraph
call, like by grabbing the duplicated object.

source/blender/blenkernel/intern/anim.c

index 8ff5ca1d12b6e39a8a964611d8ef6bfd4052324e..afd56ffaabde76c450e661a4513e21bfec871938 100644 (file)
@@ -497,7 +497,10 @@ static void particle_duplilist(ListBase *lb, Scene *sce, Object *par, PartEff *p
                                                                }
                                                                
                                                                VECCOPY(ob->obmat[3], vec);
                                                                }
                                                                
                                                                VECCOPY(ob->obmat[3], vec);
-                                                               new_dupli_object(lb, ob, ob->obmat, par->lay);
+                                                               /* put object back in original state, so it cam be restored OK */
+                                                               Mat4CpyMat4(tmat, ob->obmat);
+                                                               Mat4CpyMat4(ob->obmat, copyob.obmat);
+                                                               new_dupli_object(lb, ob, tmat, par->lay);
                                                        }
                                                }
                                                else { // non static particles
                                                        }
                                                }
                                                else { // non static particles
@@ -523,7 +526,11 @@ static void particle_duplilist(ListBase *lb, Scene *sce, Object *par, PartEff *p
                                                        }
 
                                                        VECCOPY(ob->obmat[3], vec);
                                                        }
 
                                                        VECCOPY(ob->obmat[3], vec);
-                                                       new_dupli_object(lb, ob, ob->obmat, par->lay);
+                                                       
+                                                       /* put object back in original state, so it cam be restored OK */
+                                                       Mat4CpyMat4(tmat, ob->obmat);
+                                                       Mat4CpyMat4(ob->obmat, copyob.obmat);
+                                                       new_dupli_object(lb, ob, tmat, par->lay);
                                                }                                       
                                        }
                                        /* temp copy, to have ipos etc to work OK */
                                                }                                       
                                        }
                                        /* temp copy, to have ipos etc to work OK */