Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/anim.c')
-rw-r--r--source/blender/blenkernel/intern/anim.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 6044cfa7692..fa0ddc5f1d3 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -1532,7 +1532,10 @@ void free_object_duplilist(ListBase *lb)
{
DupliObject *dob;
- for(dob= lb->first; dob; dob= dob->next) {
+ /* loop in reverse order, if object is instanced multiple times
+ the original layer may not really be original otherwise, proper
+ solution is more complicated */
+ for(dob= lb->last; dob; dob= dob->prev) {
dob->ob->lay= dob->origlay;
copy_m4_m4(dob->ob->obmat, dob->omat);
}