diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-11-15 16:44:36 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-11-22 12:13:33 +0300 |
commit | 05306d97663b4281d4b17bfc7e1ed913ce07966f (patch) | |
tree | 4c3ed1c62684c317ded5217cf4f40b4589d395dc | |
parent | f15c63b0c2216fdebe559a0ed0f93765e6e763dc (diff) |
SceneRenderLayer > SceneLayer: Convert material_override
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_layer.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library_query.c | 3 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 9 | ||||
-rw-r--r-- | source/blender/render/extern/include/RE_pipeline.h | 2 | ||||
-rw-r--r-- | source/blender/render/extern/include/RE_shader_ext.h | 1 | ||||
-rw-r--r-- | source/blender/render/intern/source/rayshade.c | 1 | ||||
-rw-r--r-- | source/blender/render/intern/source/render_result.c | 1 | ||||
-rw-r--r-- | source/blender/render/intern/source/rendercore.c | 1 | ||||
-rw-r--r-- | source/blender/render/intern/source/shadeinput.c | 5 | ||||
-rw-r--r-- | source/blender/render/intern/source/volumetric.c | 1 |
16 files changed, 13 insertions, 32 deletions
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index d18a7f25317..cbe373eff6b 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -409,7 +409,7 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D& b_v3d, const char *layer) render_layer.layer = get_layer(b_rlay->layers()); render_layer.layer |= render_layer.holdout_layer; - render_layer.material_override = b_rlay->material_override(); + render_layer.material_override = PointerRNA_NULL; render_layer.use_background_shader = b_rlay->use_sky(); render_layer.use_background_ao = b_rlay->use_ao(); render_layer.use_surfaces = b_rlay->use_solid(); diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index 0f9cd86bd3c..a0cbc45da98 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -202,7 +202,7 @@ private: uint layer; uint holdout_layer; uint exclude_layer; /* This can be safely removed from Cycles. */ - BL::Material material_override; + BL::Material material_override; /* This can be safely removed from Cycles. */ bool use_background_shader; bool use_background_ao; bool use_surfaces; diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index 38cecdc3e0f..ad2f196866f 100644 --- a/source/blender/blenkernel/BKE_layer.h +++ b/source/blender/blenkernel/BKE_layer.h @@ -108,7 +108,7 @@ void BKE_layer_sync_object_unlink(const struct Scene *scene, struct SceneCollect /* override */ -void BKE_collection_override_datablock_add(struct LayerCollection *lc, const char *data_path, struct ID *id); +void BKE_override_scene_layer_datablock_add(struct SceneLayer *scene_layer, int id_type, const char *data_path, const struct ID *id); /* engine settings */ typedef void (*EngineSettingsCB)(struct RenderEngine *engine, struct IDProperty *props); diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index c6ee00c5839..3c9c110625b 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -1060,8 +1060,9 @@ void BKE_layer_sync_object_unlink(const Scene *scene, SceneCollection *sc, Objec /** * Add a new datablock override */ -void BKE_collection_override_datablock_add(LayerCollection *UNUSED(lc), const char *UNUSED(data_path), ID *UNUSED(id)) +void BKE_override_scene_layer_datablock_add(SceneLayer *scene_layer, int id_type, const char *data_path, const ID *id) { + UNUSED_VARS(scene_layer, id_type, data_path, id); TODO_LAYER_OVERRIDE; } diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index b00dc54d08a..b6f1b6529e9 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -425,9 +425,6 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call FreestyleModuleConfig *fmc; FreestyleLineSet *fls; - if (srl->mat_override) { - CALLBACK_INVOKE(srl->mat_override, IDWALK_CB_USER); - } for (fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) { if (fmc->script) { CALLBACK_INVOKE(fmc->script, IDWALK_CB_NOP); diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 9b06a79f651..d38a9a12999 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -307,7 +307,11 @@ void do_versions_after_linking_280(Main *main) SceneLayer *scene_layer = BKE_scene_layer_add(scene, srl->name); if (srl->mat_override) { - BKE_collection_override_datablock_add((LayerCollection *)scene_layer->layer_collections.first, "material", (ID *)srl->mat_override); + BKE_override_scene_layer_datablock_add( + scene_layer, + ID_MA, + "self", + (ID *)srl->mat_override); } if (srl->lay != scene->lay) { diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 6cd6a26884b..8c17522103d 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -368,10 +368,6 @@ static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *s TreeElement *tenlay = outliner_add_element(soops, &tenla->subtree, sce, te, TSE_R_LAYER, a); tenlay->name = srl->name; tenlay->directdata = &srl->layflag; - - if (srl->mat_override) - outliner_add_element(soops, &tenlay->subtree, srl->mat_override, tenlay, TSE_LINKED_MAT, 0); - outliner_add_passes(soops, tenlay, &sce->id, srl); } diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 766ef1e8f34..3e554bafdf2 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -174,7 +174,7 @@ typedef struct SceneRenderLayer { char name[64]; /* MAX_NAME */ - struct Material *mat_override; + struct Material *mat_override DNA_DEPRECATED; /* Converted to SceneLayer override. */ unsigned int lay; /* scene->lay itself has priority over this */ unsigned int lay_zmask; /* has to be after lay, this is for Z-masking */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 8b244fdf91f..f653fcfa238 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -3281,15 +3281,6 @@ void rna_def_render_layer_common(StructRNA *srna, int scene) if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL); else RNA_def_property_clear_flag(prop, PROP_EDITABLE); - prop = RNA_def_property(srna, "material_override", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "mat_override"); - RNA_def_property_struct_type(prop, "Material"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Material Override", - "Material to override all other materials in this render layer"); - if (scene) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneRenderLayer_pass_update"); - else RNA_def_property_clear_flag(prop, PROP_EDITABLE); - /* layers */ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "lay", 1); diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h index 89136da9749..97b3af6c1b4 100644 --- a/source/blender/render/extern/include/RE_pipeline.h +++ b/source/blender/render/extern/include/RE_pipeline.h @@ -111,8 +111,6 @@ typedef struct RenderLayer { unsigned int lay, lay_zmask; int layflag, passflag, pass_xor; - struct Material *mat_override; - /* MULTIVIEW_TODO: acolrect and scolrect are not supported by multiview at the moment. * If they are really required they should be in RenderView instead */ diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index 870e80257ea..0b392c122db 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -179,7 +179,6 @@ typedef struct ShadeInput { unsigned int lay; int layflag, passflag, combinedflag; short object_pass_index; - struct Material *mat_override; #ifdef RE_RAYCOUNTER RayCounter raycounter; diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 8b268f7d844..7bac7f29c5a 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -742,7 +742,6 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, con shi.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */ shi.combinedflag= 0xFFFFFF; /* ray trace does all options */ //shi.do_preview = false; // memset above, so don't need this - shi.mat_override= origshi->mat_override; shade_ray(&isec, &shi, &shr); /* ray has traveled inside the material, so shade by transmission */ diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index bc9bd60315e..ecd8d853586 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -318,7 +318,6 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf rl->layflag = srl->layflag; rl->passflag = srl->passflag; /* for debugging: srl->passflag | SCE_PASS_RAYHITS; */ rl->pass_xor = srl->pass_xor; - rl->mat_override = srl->mat_override; rl->rectx = rectx; rl->recty = recty; diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index fa6d6d42c6b..4e8e1b9a5e8 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -1660,7 +1660,6 @@ void zbufshade_sss_tile(RenderPart *pa) rl= rr->layers.first; ssamp.shi[0].passflag |= SCE_PASS_RGBA|SCE_PASS_COMBINED; ssamp.shi[0].combinedflag &= ~(SCE_PASS_SPEC); - ssamp.shi[0].mat_override= NULL; lay= ssamp.shi[0].lay; /* create the pixelstrs to be used later */ diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 0e97a334420..067e7861b51 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -268,7 +268,7 @@ void shade_input_set_triangle_i(ShadeInput *shi, ObjectInstanceRen *obi, VlakRen shi->i3 = i3; /* note, shi->mat is set in node shaders */ - shi->mat = shi->mat_override ? shi->mat_override : vlr->mat; + shi->mat = vlr->mat; shi->osatex = (shi->mat->texco & TEXCO_OSA); shi->mode = shi->mat->mode_l; /* or-ed result for all nodes */ @@ -325,7 +325,7 @@ void shade_input_copy_triangle(ShadeInput *shi, ShadeInput *from) void shade_input_set_strand(ShadeInput *shi, StrandRen *strand, StrandPoint *spoint) { /* note, shi->mat is set in node shaders */ - shi->mat = shi->mat_override ? shi->mat_override : strand->buffer->ma; + shi->mat = strand->buffer->ma; shi->osatex = (shi->mat->texco & TEXCO_OSA); shi->mode = shi->mat->mode_l; /* or-ed result for all nodes */ @@ -1304,7 +1304,6 @@ void shade_input_initialize(ShadeInput *shi, RenderPart *pa, RenderLayer *rl, in shi->layflag = rl->layflag; shi->passflag = rl->passflag; shi->combinedflag = ~rl->pass_xor; - shi->mat_override = rl->mat_override; // shi->rl= rl; /* note shi.depth==0 means first hit, not raytracing */ diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 16fba22404a..e12a7246254 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -172,7 +172,6 @@ static void shade_intersection(ShadeInput *shi, float col_r[4], Isect *is) shi_new.lay = shi->lay; shi_new.passflag = SCE_PASS_COMBINED; /* result of tracing needs no pass info */ shi_new.combinedflag = 0xFFFFFF; /* ray trace does all options */ - shi_new.mat_override = shi->mat_override; copy_v3_v3(shi_new.camera_co, is->start); |