Changeset View
Changeset View
Standalone View
Standalone View
source/blender/render/intern/source/pipeline.c
| Show First 20 Lines • Show All 1,230 Lines • ▼ Show 20 Lines | |||||
| * properly without hacks from their side. | * properly without hacks from their side. | ||||
| * - sergey - | * - sergey - | ||||
| */ | */ | ||||
| #define DEPSGRAPH_WORKAROUND_HACK | #define DEPSGRAPH_WORKAROUND_HACK | ||||
| #ifdef DEPSGRAPH_WORKAROUND_HACK | #ifdef DEPSGRAPH_WORKAROUND_HACK | ||||
| static void tag_dependend_object_for_render(Scene *scene, Object *object); | static void tag_dependend_object_for_render(Scene *scene, Object *object); | ||||
| static void tag_dependend_group_for_render(Scene *scene, Group *group) | static void tag_dependend_group_for_render(Scene *scene, Collection *collection) | ||||
| { | { | ||||
| if (group->id.tag & LIB_TAG_DOIT) { | if (collection->id.tag & LIB_TAG_DOIT) { | ||||
| return; | return; | ||||
| } | } | ||||
| group->id.tag |= LIB_TAG_DOIT; | collection->id.tag |= LIB_TAG_DOIT; | ||||
| for (GroupObject *go = group->gobject.first; go != NULL; go = go->next) { | for (CollectionObject *cob = collection->gobject.first; cob != NULL; cob = cob->next) { | ||||
| Object *object = go->ob; | Object *object = cob->ob; | ||||
| tag_dependend_object_for_render(scene, object); | tag_dependend_object_for_render(scene, object); | ||||
| } | } | ||||
| } | } | ||||
| static void tag_dependend_object_for_render(Scene *scene, Object *object) | static void tag_dependend_object_for_render(Scene *scene, Object *object) | ||||
| { | { | ||||
| if (object->type == OB_MESH) { | if (object->type == OB_MESH) { | ||||
| if (RE_allow_render_generic_object(object)) { | if (RE_allow_render_generic_object(object)) { | ||||
| Show All 40 Lines | if (RE_allow_render_generic_object(object)) { | ||||
| switch (part->ren_as) { | switch (part->ren_as) { | ||||
| case PART_DRAW_OB: | case PART_DRAW_OB: | ||||
| if (part->dup_ob != NULL) { | if (part->dup_ob != NULL) { | ||||
| DEG_id_tag_update(&part->dup_ob->id, OB_RECALC_DATA); | DEG_id_tag_update(&part->dup_ob->id, OB_RECALC_DATA); | ||||
| } | } | ||||
| break; | break; | ||||
| case PART_DRAW_GR: | case PART_DRAW_GR: | ||||
| if (part->dup_group != NULL) { | if (part->dup_group != NULL) { | ||||
| for (GroupObject *go = part->dup_group->gobject.first; | FOREACH_COLLECTION_BASE_RECURSIVE_BEGIN(part->dup_group, base) | ||||
| go != NULL; | |||||
| go = go->next) | |||||
| { | { | ||||
| DEG_id_tag_update(&go->ob->id, OB_RECALC_DATA); | Object *ob = base->object; | ||||
| DEG_id_tag_update(&ob->id, OB_RECALC_DATA); | |||||
| } | } | ||||
| FOREACH_COLLECTION_BASE_RECURSIVE_END | |||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (object->dup_group != NULL) { | if (object->dup_group != NULL) { | ||||
| ▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | static void ntree_render_scenes(Render *re) | ||||
| Scene *restore_scene = re->scene; | Scene *restore_scene = re->scene; | ||||
| bool scene_changed = false; | bool scene_changed = false; | ||||
| if (re->scene->nodetree == NULL) return; | if (re->scene->nodetree == NULL) return; | ||||
| tag_scenes_for_render(re); | tag_scenes_for_render(re); | ||||
| #ifdef DEPSGRAPH_WORKAROUND_GROUP_HACK | #ifdef DEPSGRAPH_WORKAROUND_GROUP_HACK | ||||
| tag_groups_for_render(re); | tag_collections_for_render(re); | ||||
| #endif | #endif | ||||
| /* now foreach render-result node tagged we do a full render */ | /* now foreach render-result node tagged we do a full render */ | ||||
| /* results are stored in a way compisitor will find it */ | /* results are stored in a way compisitor will find it */ | ||||
| for (node = re->scene->nodetree->nodes.first; node; node = node->next) { | for (node = re->scene->nodetree->nodes.first; node; node = node->next) { | ||||
| if (node->type == CMP_NODE_R_LAYERS && (node->flag & NODE_MUTED) == 0) { | if (node->type == CMP_NODE_R_LAYERS && (node->flag & NODE_MUTED) == 0) { | ||||
| if (node->id && node->id != (ID *)re->scene) { | if (node->id && node->id != (ID *)re->scene) { | ||||
| if (node->flag & NODE_TEST) { | if (node->flag & NODE_TEST) { | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | static void do_render_composite(Render *re) | ||||
| } | } | ||||
| #ifdef WITH_FREESTYLE | #ifdef WITH_FREESTYLE | ||||
| free_all_freestyle_renders(); | free_all_freestyle_renders(); | ||||
| #endif | #endif | ||||
| #ifdef DEPSGRAPH_WORKAROUND_GROUP_HACK | #ifdef DEPSGRAPH_WORKAROUND_GROUP_HACK | ||||
| /* Restore their visibility based on the viewport visibility flags. */ | /* Restore their visibility based on the viewport visibility flags. */ | ||||
| tag_groups_for_render(re); | tag_collections_for_render(re); | ||||
| #endif | #endif | ||||
| /* weak... the display callback wants an active renderlayer pointer... */ | /* weak... the display callback wants an active renderlayer pointer... */ | ||||
| if (re->result != NULL) { | if (re->result != NULL) { | ||||
| re->result->renlay = render_get_active_layer(re, re->result); | re->result->renlay = render_get_active_layer(re, re->result); | ||||
| re->display_update(re->duh, re->result, NULL); | re->display_update(re->duh, re->result, NULL); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 499 Lines • ▼ Show 20 Lines | if (anim) { | ||||
| re->disprect = disprect; | re->disprect = disprect; | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| /* check all scenes involved */ | /* check all scenes involved */ | ||||
| tag_scenes_for_render(re); | tag_scenes_for_render(re); | ||||
| #ifdef DEPSGRAPH_WORKAROUND_GROUP_HACK | #ifdef DEPSGRAPH_WORKAROUND_GROUP_HACK | ||||
| /* Update group collections visibility. */ | /* Update collection collections visibility. */ | ||||
| tag_groups_for_render(re); | tag_collections_for_render(re); | ||||
| #endif | #endif | ||||
| /* | /* | ||||
| * Disabled completely for now, | * Disabled completely for now, | ||||
| * can be later set as render profile option | * can be later set as render profile option | ||||
| * and default for background render. | * and default for background render. | ||||
| */ | */ | ||||
| if (0) { | if (0) { | ||||
| ▲ Show 20 Lines • Show All 872 Lines • Show Last 20 Lines | |||||