Bugfix, report from studio Manos;
This tweaks the dependency rules for Scenes/Objects a bit. Here is the rule: - Each Scene has own dependency graph, and only solves dependencies for objects in the scene - However, when using multiple linked Scene-sets, the *current* scene is allowed to have dependencies to objects in a 'set'. This works by first calculating the sets, then the current scene. Example: the current scene can have lights with a track/location constraint to a character in a set.
This commit is contained in:
@@ -501,35 +501,44 @@ int scene_check_setscene(Scene *sce)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* applies changes right away */
|
||||
void scene_update_for_newframe(Scene *sce, unsigned int lay)
|
||||
static void scene_update(Scene *sce, unsigned int lay)
|
||||
{
|
||||
Base *base;
|
||||
Object *ob;
|
||||
|
||||
if(sce->theDag==NULL)
|
||||
DAG_scene_sort(sce);
|
||||
|
||||
DAG_scene_update_flags(sce, lay); // only stuff that moves or needs display still
|
||||
|
||||
for(base= sce->base.first; base; base= base->next) {
|
||||
ob= base->object;
|
||||
|
||||
object_handle_update(ob); // bke_object.h
|
||||
|
||||
/* only update layer when an ipo */
|
||||
if(ob->ipo && has_ipo_code(ob->ipo, OB_LAY) ) {
|
||||
base->lay= ob->lay;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* applies changes right away, does all sets too */
|
||||
void scene_update_for_newframe(Scene *sce, unsigned int lay)
|
||||
{
|
||||
Scene *scene= sce;
|
||||
|
||||
/* object ipos are calculated in where_is_object */
|
||||
do_all_data_ipos();
|
||||
|
||||
if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_FRAMECHANGED);
|
||||
|
||||
while(sce) {
|
||||
if(sce->theDag==NULL)
|
||||
DAG_scene_sort(sce);
|
||||
|
||||
DAG_scene_update_flags(sce, lay); // only stuff that moves or needs display still
|
||||
|
||||
for(base= sce->base.first; base; base= base->next) {
|
||||
ob= base->object;
|
||||
|
||||
object_handle_update(ob); // bke_object.h
|
||||
|
||||
/* only update layer when an ipo */
|
||||
if(ob->ipo && has_ipo_code(ob->ipo, OB_LAY) ) {
|
||||
base->lay= ob->lay;
|
||||
}
|
||||
}
|
||||
sce= sce->set;
|
||||
}
|
||||
/* sets first, we allow per definition current scene to have dependencies on sets */
|
||||
for(sce= sce->set; sce; sce= sce->set)
|
||||
scene_update(sce, lay);
|
||||
|
||||
scene_update(scene, lay);
|
||||
|
||||
}
|
||||
|
||||
/* return default layer, also used to patch old files */
|
||||
|
||||
@@ -427,12 +427,12 @@ void freeoctree(Render *re)
|
||||
{
|
||||
Octree *oc= &re->oc;
|
||||
|
||||
if(G.f & G_DEBUG) {
|
||||
printf("branches %d nodes %d\n", oc->branchcount, oc->nodecount);
|
||||
printf("raycount %d \n", raycount);
|
||||
printf("ray coherent %d \n", coherent_ray);
|
||||
printf("accepted %d rejected %d\n", accepted, rejected);
|
||||
}
|
||||
#if 0
|
||||
printf("branches %d nodes %d\n", oc->branchcount, oc->nodecount);
|
||||
printf("raycount %d \n", raycount);
|
||||
printf("ray coherent %d \n", coherent_ray);
|
||||
printf("accepted %d rejected %d\n", accepted, rejected);
|
||||
#endif
|
||||
|
||||
if(oc->adrbranch) {
|
||||
int a= 0;
|
||||
|
||||
@@ -2639,9 +2639,13 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
|
||||
|
||||
/* update all objects, ipos, matrices, displists, etc. Flags set by depgraph or manual,
|
||||
no layer check here, gets correct flushed */
|
||||
for(SETLOOPER(G.scene, base)) {
|
||||
object_handle_update(base->object); // bke_object.h
|
||||
/* sets first, we allow per definition current scene to have dependencies on sets */
|
||||
if(G.scene->set) {
|
||||
for(SETLOOPER(G.scene->set, base))
|
||||
object_handle_update(base->object); // bke_object.h
|
||||
}
|
||||
for(base= G.scene->base.first; base; base= base->next)
|
||||
object_handle_update(base->object); // bke_object.h
|
||||
|
||||
setwinmatrixview3d(sa->winx, sa->winy, NULL); /* 0= no pick rect */
|
||||
setviewmatrixview3d(); /* note: calls where_is_object for camera... */
|
||||
|
||||
Reference in New Issue
Block a user