Fix T65134: Duplicated proxies in several scenes don't work
This is something which worked in Blender 2.79. Need to do special trickery to ensure peoxy_from points to a proper object. Differential Revision: https://developer.blender.org/D6040
This commit is contained in:
parent
1857aa32bd
commit
eac0f35845
@ -643,6 +643,10 @@ void BKE_pose_eval_init(struct Depsgraph *depsgraph, Scene *UNUSED(scene), Objec
|
||||
}
|
||||
|
||||
BLI_assert(pose->chan_array != NULL || BLI_listbase_is_empty(&pose->chanbase));
|
||||
|
||||
if (object->proxy != NULL) {
|
||||
object->proxy->proxy_from = object;
|
||||
}
|
||||
}
|
||||
|
||||
void BKE_pose_eval_init_ik(struct Depsgraph *depsgraph, Scene *scene, Object *object)
|
||||
|
@ -527,6 +527,9 @@ void DepsgraphNodeBuilder::build_object(int base_index,
|
||||
eDepsNode_LinkedState_Type linked_state,
|
||||
bool is_visible)
|
||||
{
|
||||
if (object->proxy != NULL) {
|
||||
object->proxy->proxy_from = object;
|
||||
}
|
||||
const bool has_object = built_map_.checkIsBuiltAndTag(object);
|
||||
/* Skip rest of components if the ID node was already there. */
|
||||
if (has_object) {
|
||||
|
@ -511,6 +511,14 @@ void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph, const bool do_ti
|
||||
* to evaluation though) with `do_time=true`. This means early output checks should be aware of
|
||||
* this. */
|
||||
for (DEG::IDNode *id_node : graph->id_nodes) {
|
||||
const ID_Type id_type = GS(id_node->id_orig->name);
|
||||
if (id_type == ID_OB) {
|
||||
Object *object_orig = reinterpret_cast<Object *>(id_node->id_orig);
|
||||
if (object_orig->proxy != NULL) {
|
||||
object_orig->proxy->proxy_from = object_orig;
|
||||
}
|
||||
}
|
||||
|
||||
if (!id_node->visible_components_mask) {
|
||||
/* ID has no components which affects anything visible.
|
||||
* No need bother with it to tag or anything. */
|
||||
@ -537,7 +545,6 @@ void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph, const bool do_ti
|
||||
* other type of cache).
|
||||
*
|
||||
* TODO(sergey): Need to generalize this somehow. */
|
||||
const ID_Type id_type = GS(id_node->id_orig->name);
|
||||
if (id_type == ID_OB) {
|
||||
flag |= ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user