Depsgraph fix for scene layers
Objects can be moved around freely now
This commit is contained in:
@@ -125,7 +125,7 @@ static void modifier_walk(void *user_data,
|
|||||||
{
|
{
|
||||||
BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
|
BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
|
||||||
if (*obpoin) {
|
if (*obpoin) {
|
||||||
data->builder->build_object(data->scene, NULL, *obpoin);
|
data->builder->build_object(data->scene, *obpoin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ void constraint_walk(bConstraint * /*con*/,
|
|||||||
if (*idpoin) {
|
if (*idpoin) {
|
||||||
ID *id = *idpoin;
|
ID *id = *idpoin;
|
||||||
if (GS(id->name) == ID_OB) {
|
if (GS(id->name) == ID_OB) {
|
||||||
data->builder->build_object(data->scene, NULL, (Object *)id);
|
data->builder->build_object(data->scene, (Object *)id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -337,9 +337,7 @@ void DepsgraphNodeBuilder::begin_build(Main *bmain) {
|
|||||||
} FOREACH_NODETREE_END
|
} FOREACH_NODETREE_END
|
||||||
}
|
}
|
||||||
|
|
||||||
void DepsgraphNodeBuilder::build_group(Scene *scene,
|
void DepsgraphNodeBuilder::build_group(Scene *scene, Group *group)
|
||||||
BaseLegacy *base,
|
|
||||||
Group *group)
|
|
||||||
{
|
{
|
||||||
ID *group_id = &group->id;
|
ID *group_id = &group->id;
|
||||||
if (group_id->tag & LIB_TAG_DOIT) {
|
if (group_id->tag & LIB_TAG_DOIT) {
|
||||||
@@ -348,7 +346,7 @@ void DepsgraphNodeBuilder::build_group(Scene *scene,
|
|||||||
group_id->tag |= LIB_TAG_DOIT;
|
group_id->tag |= LIB_TAG_DOIT;
|
||||||
|
|
||||||
LINKLIST_FOREACH (GroupObject *, go, &group->gobject) {
|
LINKLIST_FOREACH (GroupObject *, go, &group->gobject) {
|
||||||
build_object(scene, base, go->ob);
|
build_object(scene, go->ob);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +385,7 @@ SubgraphDepsNode *DepsgraphNodeBuilder::build_subgraph(Group *group)
|
|||||||
return subgraph_node;
|
return subgraph_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DepsgraphNodeBuilder::build_object(Scene *scene, BaseLegacy *base, Object *ob)
|
void DepsgraphNodeBuilder::build_object(Scene *scene, Object *ob)
|
||||||
{
|
{
|
||||||
const bool has_object = (ob->id.tag & LIB_TAG_DOIT);
|
const bool has_object = (ob->id.tag & LIB_TAG_DOIT);
|
||||||
IDDepsNode *id_node = (has_object)
|
IDDepsNode *id_node = (has_object)
|
||||||
@@ -397,9 +395,12 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, BaseLegacy *base, Object *
|
|||||||
* Do it for both new and existing ID nodes. This is so because several
|
* Do it for both new and existing ID nodes. This is so because several
|
||||||
* bases might be sharing same object.
|
* bases might be sharing same object.
|
||||||
*/
|
*/
|
||||||
if (base != NULL) {
|
|
||||||
id_node->layers |= base->lay;
|
/* Blender 2.8 transition: we don't have bases and do not have
|
||||||
}
|
* layer masks, but still want objects to be updated
|
||||||
|
*/
|
||||||
|
id_node->layers |= ((1 << 20) - 1);
|
||||||
|
|
||||||
if (ob == scene->camera) {
|
if (ob == scene->camera) {
|
||||||
/* Camera should always be updated, it used directly by viewport. */
|
/* Camera should always be updated, it used directly by viewport. */
|
||||||
id_node->layers |= (unsigned int)(-1);
|
id_node->layers |= (unsigned int)(-1);
|
||||||
@@ -415,7 +416,7 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, BaseLegacy *base, Object *
|
|||||||
build_object_transform(scene, ob);
|
build_object_transform(scene, ob);
|
||||||
|
|
||||||
if (ob->parent != NULL) {
|
if (ob->parent != NULL) {
|
||||||
build_object(scene, NULL, ob->parent);
|
build_object(scene, ob->parent);
|
||||||
}
|
}
|
||||||
if (ob->modifiers.first != NULL) {
|
if (ob->modifiers.first != NULL) {
|
||||||
BuilderWalkUserData data;
|
BuilderWalkUserData data;
|
||||||
@@ -927,13 +928,13 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
|
|||||||
*/
|
*/
|
||||||
Curve *cu = (Curve *)obdata;
|
Curve *cu = (Curve *)obdata;
|
||||||
if (cu->bevobj != NULL) {
|
if (cu->bevobj != NULL) {
|
||||||
build_object(scene, NULL, cu->bevobj);
|
build_object(scene, cu->bevobj);
|
||||||
}
|
}
|
||||||
if (cu->taperobj != NULL) {
|
if (cu->taperobj != NULL) {
|
||||||
build_object(scene, NULL, cu->taperobj);
|
build_object(scene, cu->taperobj);
|
||||||
}
|
}
|
||||||
if (ob->type == OB_FONT && cu->textoncurve != NULL) {
|
if (ob->type == OB_FONT && cu->textoncurve != NULL) {
|
||||||
build_object(scene, NULL, cu->textoncurve);
|
build_object(scene, cu->textoncurve);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -32,10 +32,6 @@
|
|||||||
|
|
||||||
#include "intern/depsgraph_types.h"
|
#include "intern/depsgraph_types.h"
|
||||||
|
|
||||||
/* XXX: Temporary solution to get proper Baselegacy. */
|
|
||||||
#include "DNA_scene_types.h"
|
|
||||||
|
|
||||||
struct BaseLegacy;
|
|
||||||
struct CacheFile;
|
struct CacheFile;
|
||||||
struct bGPdata;
|
struct bGPdata;
|
||||||
struct ListBase;
|
struct ListBase;
|
||||||
@@ -129,8 +125,8 @@ struct DepsgraphNodeBuilder {
|
|||||||
|
|
||||||
void build_scene(Main *bmain, Scene *scene);
|
void build_scene(Main *bmain, Scene *scene);
|
||||||
SubgraphDepsNode *build_subgraph(Group *group);
|
SubgraphDepsNode *build_subgraph(Group *group);
|
||||||
void build_group(Scene *scene, BaseLegacy *base, Group *group);
|
void build_group(Scene *scene, Group *group);
|
||||||
void build_object(Scene *scene, BaseLegacy *base, Object *ob);
|
void build_object(Scene *scene, Object *ob);
|
||||||
void build_object_transform(Scene *scene, Object *ob);
|
void build_object_transform(Scene *scene, Object *ob);
|
||||||
void build_object_constraints(Scene *scene, Object *ob);
|
void build_object_constraints(Scene *scene, Object *ob);
|
||||||
void build_pose_constraints(Object *ob, bPoseChannel *pchan);
|
void build_pose_constraints(Object *ob, bPoseChannel *pchan);
|
||||||
|
@@ -46,6 +46,7 @@ extern "C" {
|
|||||||
#include "DNA_object_types.h"
|
#include "DNA_object_types.h"
|
||||||
#include "DNA_scene_types.h"
|
#include "DNA_scene_types.h"
|
||||||
|
|
||||||
|
#include "BKE_layer.h"
|
||||||
#include "BKE_main.h"
|
#include "BKE_main.h"
|
||||||
#include "BKE_node.h"
|
#include "BKE_node.h"
|
||||||
|
|
||||||
@@ -79,24 +80,25 @@ void DepsgraphNodeBuilder::build_scene(Main *bmain, Scene *scene)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* scene objects */
|
/* scene objects */
|
||||||
LINKLIST_FOREACH (BaseLegacy *, base, &scene->base) {
|
Object *ob;
|
||||||
Object *ob = base->object;
|
FOREACH_SCENE_OBJECT(scene, ob)
|
||||||
|
{
|
||||||
/* object itself */
|
/* object itself */
|
||||||
build_object(scene, base, ob);
|
build_object(scene, ob);
|
||||||
|
|
||||||
/* object that this is a proxy for */
|
/* object that this is a proxy for */
|
||||||
// XXX: the way that proxies work needs to be completely reviewed!
|
// XXX: the way that proxies work needs to be completely reviewed!
|
||||||
if (ob->proxy) {
|
if (ob->proxy) {
|
||||||
ob->proxy->proxy_from = ob;
|
ob->proxy->proxy_from = ob;
|
||||||
build_object(scene, base, ob->proxy);
|
build_object(scene, ob->proxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Object dupligroup. */
|
/* Object dupligroup. */
|
||||||
if (ob->dup_group) {
|
if (ob->dup_group) {
|
||||||
build_group(scene, base, ob->dup_group);
|
build_group(scene, ob->dup_group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FOREACH_SCENE_OBJECT_END
|
||||||
|
|
||||||
/* rigidbody */
|
/* rigidbody */
|
||||||
if (scene->rigidbody_world) {
|
if (scene->rigidbody_world) {
|
||||||
|
@@ -46,6 +46,7 @@ extern "C" {
|
|||||||
#include "DNA_object_types.h"
|
#include "DNA_object_types.h"
|
||||||
#include "DNA_scene_types.h"
|
#include "DNA_scene_types.h"
|
||||||
|
|
||||||
|
#include "BKE_layer.h"
|
||||||
#include "BKE_main.h"
|
#include "BKE_main.h"
|
||||||
#include "BKE_node.h"
|
#include "BKE_node.h"
|
||||||
|
|
||||||
@@ -74,9 +75,9 @@ void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* scene objects */
|
/* scene objects */
|
||||||
LINKLIST_FOREACH (BaseLegacy *, base, &scene->base) {
|
Object *ob;
|
||||||
Object *ob = base->object;
|
FOREACH_SCENE_OBJECT(scene, ob)
|
||||||
|
{
|
||||||
/* object itself */
|
/* object itself */
|
||||||
build_object(bmain, scene, ob);
|
build_object(bmain, scene, ob);
|
||||||
|
|
||||||
@@ -97,6 +98,7 @@ void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene)
|
|||||||
build_group(bmain, scene, ob, ob->dup_group);
|
build_group(bmain, scene, ob, ob->dup_group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FOREACH_SCENE_OBJECT_END
|
||||||
|
|
||||||
/* rigidbody */
|
/* rigidbody */
|
||||||
if (scene->rigidbody_world) {
|
if (scene->rigidbody_world) {
|
||||||
|
Reference in New Issue
Block a user