Revision: 36762
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36762
Author:   campbellbarton
Date:     2011-05-19 06:17:44 +0000 (Thu, 19 May 2011)
Log Message:
-----------
fix [#27437] Appending armatures with custom bone shapes brings no custom 
objects into scene.. impossible to edit

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c   2011-05-19 
04:28:09 UTC (rev 36761)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c   2011-05-19 
06:17:44 UTC (rev 36762)
@@ -4140,7 +4140,7 @@
        bActuator *act;
        int a;
        
-       /* weak weak... this was only meant as draw flag, now is used in 
give_base too */
+       /* weak weak... this was only meant as draw flag, now is used in 
give_base_to_objects too */
        ob->flag &= ~OB_FROMGROUP;
 
        /* loading saved files with editmode enabled works, but for undo we like
@@ -12735,12 +12735,22 @@
                                
                                int do_it= 0;
                                
-                               if(ob->id.us==0)
+                               if(ob->id.us==0) {
                                        do_it= 1;
-                               else if(ob->id.us==1 && lib)
-                                       if(ob->id.lib==lib && (ob->flag & 
OB_FROMGROUP) && object_in_any_scene(mainvar, ob)==0)
+                               }
+                               else if (lib==NULL) { /* appending */
+                                       if(object_in_any_scene(mainvar, ob)==0) 
{
+                                               /* when appending, make sure 
any indirectly loaded objects
+                                                * get a base else they cant be 
accessed at all [#27437] */
                                                do_it= 1;
-                                               
+                                       }
+                               }
+                               else if(ob->id.us==1 && lib) {
+                                       if(ob->id.lib==lib && (ob->flag & 
OB_FROMGROUP) && object_in_any_scene(mainvar, ob)==0) {
+                                               do_it= 1;
+                                       }
+                               }
+
                                if(do_it) {
                                        base= MEM_callocN( sizeof(Base), 
"add_ext_base");
                                        BLI_addtail(&(sce->base), base);
@@ -13010,6 +13020,9 @@
                        give_base_to_objects(mainvar, scene, NULL, 0);
                }
        }
+       else {
+               printf("library_append_end, scene is NULL (objects wont get 
bases)\n");
+       }
        /* has been removed... erm, why? s..ton) */
        /* 20040907: looks like they are give base already in 
append_named_part(); -Nathan L */
        /* 20041208: put back. It only linked direct, not indirect objects 
(ton) */

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to