Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_internal.c
| Context not available. | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "../../render/intern/include/render_types.h" | |||||
brecht: We shouldn't be including internal headers from the render/ module.
If you need to access… | |||||
| #include "render_intern.h" | #include "render_intern.h" | ||||
| /* Render Callbacks */ | /* Render Callbacks */ | ||||
| Context not available. | |||||
| ScrArea *sa; | ScrArea *sa; | ||||
| for (sa = win->screen->areabase.first; sa; sa = sa->next) { | for (sa = win->screen->areabase.first; sa; sa = sa->next) { | ||||
| if (sa == rj->sa) { | if (sa == rj->sa) { | ||||
| if (sa->spacetype == SPACE_IMAGE) { | if (sa->spacetype == SPACE_IMAGE) { | ||||
| SpaceImage *sima = sa->spacedata.first; | SpaceImage *sima = sa->spacedata.first; | ||||
| sima->iuser.layer = rj->orig_layer; | Render *re = rj->re; | ||||
| } | RenderResult * rr = re->result; | ||||
| if(re->r.scemode & R_SINGLE_LAYER){ | |||||
brechtUnsubmitted Not Done Inline ActionsCode style convention: if (re->r.scemode & R_SINGLE_LAYER) {brecht: Code style convention:
```
if (re->r.scemode & R_SINGLE_LAYER) {
``` | |||||
| //Get the layer name of active layer | |||||
| RenderLayer *rl_active = BLI_findlink(&re->r.layers, re->r.actlay); | |||||
| rl_active = rl_active ? rl_active : re->r.layers.first; | |||||
| //Find the index of rl_active in the rendered layers list by string name | |||||
| int index = BLI_findstringindex(&rr->layers, rl_active->name, offsetof(RenderLayer, name)); | |||||
| sima->iuser.layer = index == -1 ? 0 : index; | |||||
brechtUnsubmitted Not Done Inline ActionsI think the simpler solution could be to just not restore the original layer in this case, since the active layer will already have been actived during the render already. Any reason that doesn't work? brecht: I think the simpler solution could be to just not restore the original layer in this case… | |||||
| } else{ | |||||
brechtUnsubmitted Not Done Inline ActionsCode style convention: }
else {
...
}brecht: Code style convention:
```
}
else {
...
}
``` | |||||
| sima->iuser.layer = rj->orig_layer; | |||||
| } | |||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
We shouldn't be including internal headers from the render/ module.
If you need to access something in the Render struct, add a function like RE_HasSingleLayer(struct Render *re) to RE_pipeline.h and pipeline.c.