diff options
author | Ton Roosendaal <ton@blender.org> | 2005-12-06 18:39:25 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-12-06 18:39:25 +0300 |
commit | 6555ddbcd88b065dbe264594e50eefcfb71d5431 (patch) | |
tree | a5465998e1d71ef12cdb6cbd68ef70c5cc652c8f /source/blender/blenkernel | |
parent | 898cbe370e0403da39347d91fc40f7a4a38aeaf2 (diff) |
Orange:
Series of fixes in Library linking of groups;
- On library-linking (SHIFT-F1) a Group, the Objects now don't get a "Base"
anymore, meaning they won't show up as Objects in the Scene.
This ensures you can use the linked Group as duplicator without having
your file polluted with new (and linked) objects.
(I realize it should be possible to have it with Base too, will check)
- On append or file-read, the linked Group Objects get drawn properly,
but the animation system doesn't run yet.
- Group buttons (F7) now shows if a Group is from Library
- Outliner draws Library linked data with blue-ish text
Other fixes;
- Using group-duplicator, with originals in hidden layer, now shows and
updates animated Objects correctly.
- All of Object button panels did not have a proper protection against
editing Library data.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_group.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 21 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/group.c | 16 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 3 |
5 files changed, 46 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h index 4e69f18a238..2d42a9e284c 100644 --- a/source/blender/blenkernel/BKE_group.h +++ b/source/blender/blenkernel/BKE_group.h @@ -45,6 +45,7 @@ void add_to_group(struct Group *group, struct Object *ob); void rem_from_group(struct Group *group, struct Object *ob); struct Group *find_group(struct Object *ob); int object_in_group(struct Object *ob, struct Group *group); +void group_tag_recalc(struct Group *group); #endif diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index b448816589f..5b5f1fabdf2 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -303,9 +303,15 @@ static void group_duplilist(Object *ob) if(ob->dup_group==NULL) return; for(go= ob->dup_group->gobject.first; go; go= go->next) { - newob= new_dupli_object(&duplilist, go->ob, ob, 0); - Mat4CpyMat4(mat, newob->obmat); - Mat4MulMat4(newob->obmat, mat, ob->obmat); + if(go->ob!=ob) { + /* we need to check update for objects that are not in scene... */ + if(go->ob->recalc) + object_handle_update(go->ob); // bke_object.h + + newob= new_dupli_object(&duplilist, go->ob, ob, 0); + Mat4CpyMat4(mat, newob->obmat); + Mat4MulMat4(newob->obmat, mat, ob->obmat); + } } } diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 50ca6bc4fe6..e317554a186 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -46,6 +46,7 @@ #include "DNA_curve_types.h" #include "DNA_ID.h" #include "DNA_effect_types.h" +#include "DNA_group_types.h" #include "DNA_lattice_types.h" #include "DNA_key_types.h" #include "DNA_mesh_types.h" @@ -441,6 +442,18 @@ struct DagForest *build_dag(struct Scene *sce, short mask) addtoroot = 0; } + if (ob->transflag & OB_DUPLI) { + if((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) { + GroupObject *go; + for(go= ob->dup_group->gobject.first; go; go= go->next) { + if(go->ob) { + node2 = dag_get_node(dag, go->ob); + dag_add_relation(dag, node2, node, DAG_RL_OB_OB); + } + } + } + } + if (ob->type==OB_MBALL) { Object *mom= find_basis_mball(ob); if(mom!=ob) { @@ -1314,10 +1327,12 @@ void DAG_scene_sort(struct Scene *sce) time++; base = sce->base.first; - while (base->object != node->ob) + while (base && base->object != node->ob) base = base->next; - BLI_remlink(&sce->base,base); - BLI_addhead(&tempbase,base); + if(base) { + BLI_remlink(&sce->base,base); + BLI_addhead(&tempbase,base); + } } } } diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 7405f16d9c0..0ae6208c9de 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -95,11 +95,12 @@ void add_to_group(Group *group, Object *ob) } +/* also used for ob==NULL */ void rem_from_group(Group *group, Object *ob) { GroupObject *go, *gon; - if(group==NULL || ob==NULL) return; + if(group==NULL) return; go= group->gobject.first; while(go) { @@ -136,3 +137,16 @@ Group *find_group(Object *ob) } return NULL; } + +void group_tag_recalc(Group *group) +{ + GroupObject *go; + + if(group==NULL) return; + + for(go= group->gobject.first; go; go= go->next) { + if(go->ob) + go->ob->recalc= OB_RECALC; + } +} + diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 2cd387d7d93..fd0a6288dbe 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -65,6 +65,7 @@ #include "BKE_constraint.h" #include "BKE_depsgraph.h" #include "BKE_global.h" +#include "BKE_group.h" #include "BKE_ipo.h" #include "BKE_key.h" #include "BKE_library.h" @@ -275,7 +276,9 @@ void set_scene_bg(Scene *sce) base->flag |= flag; ob->flag= base->flag; + ob->recalc= OB_RECALC; + if(ob->dup_group) group_tag_recalc(ob->dup_group); /* for lib-linked stuff */ ob->ctime= -1234567.0; /* force ipo to be calculated later */ base= base->next; |