diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-01-25 16:31:54 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-01-25 16:31:54 +0300 |
commit | 748adb37e5a0c4de136fae64e9b1aa41defee3cf (patch) | |
tree | 7748703338475df01bd4bf08e59acbaaf4e1ea89 | |
parent | e057d7b9eb3f7641008e2cd77be9691d84433e5d (diff) | |
parent | da4c3f30d984b361d7c00b103ec329d5263779ff (diff) |
Merge remote-tracking branch 'origin/master' into blender2.8
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 8 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 35 | ||||
-rw-r--r-- | intern/cycles/blender/addon/version_update.py | 6 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 6 | ||||
-rw-r--r-- | source/blender/editors/render/render_shading.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_select.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_select.c | 3 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/render_result.c | 6 |
10 files changed, 59 insertions, 24 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 91119c5c71c..fb7530f8663 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -42,9 +42,9 @@ enum_feature_set = ( ) enum_displacement_methods = ( - ('BUMP', "Bump", "Bump mapping to simulate the appearance of displacement"), - ('TRUE', "True", "Use true displacement only, requires fine subdivision"), - ('BOTH', "Both", "Combination of displacement and bump mapping"), + ('BUMP', "Bump Only", "Bump mapping to simulate the appearance of displacement"), + ('DISPLACEMENT', "Displacement Only", "Use true displacement of surface only, requires fine subdivision"), + ('BOTH', "Displacement and Bump", "Combination of true displacement and bump mapping for finer detail"), ) enum_bvh_layouts = ( @@ -872,7 +872,7 @@ class CyclesMaterialSettings(bpy.types.PropertyGroup): name="Displacement Method", description="Method to use for the displacement", items=enum_displacement_methods, - default='BUMP', + default='DISPLACEMENT', ) @classmethod diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 7e650cfef22..77e5cc8cf86 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1250,7 +1250,6 @@ class CYCLES_MATERIAL_PT_displacement(CyclesButtonsPanel, Panel): class CYCLES_MATERIAL_PT_settings(CyclesButtonsPanel, Panel): bl_label = "Settings" bl_context = "material" - bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): @@ -1270,8 +1269,11 @@ class CYCLES_MATERIAL_PT_settings(CyclesButtonsPanel, Panel): if context.scene.cycles.feature_set == 'EXPERIMENTAL': col.separator() - col.label(text="Displacement:") + col.label(text="Geometry:") col.prop(cmat, "displacement_method", text="") + else: + col.separator() + col.prop(mat, "pass_index") col = split.column() col.label(text="Volume:") @@ -1281,26 +1283,40 @@ class CYCLES_MATERIAL_PT_settings(CyclesButtonsPanel, Panel): col.prop(cmat, "volume_interpolation", text="") col.prop(cmat, "homogeneous_volume", text="Homogeneous") - layout.separator() + if context.scene.cycles.feature_set == 'EXPERIMENTAL': + col.separator() + col.prop(mat, "pass_index") + + +class CYCLES_MATERIAL_PT_viewport(CyclesButtonsPanel, Panel): + bl_label = "Viewport" + bl_context = "material" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + return context.material and CyclesButtonsPanel.poll(context) + + def draw(self, context): + mat = context.material + + layout = self.layout split = layout.split() col = split.column(align=True) - col.label("Viewport Color:") + col.label("Color:") col.prop(mat, "diffuse_color", text="") col.prop(mat, "alpha") col.separator() - col.label("Viewport Alpha:") + col.label("Alpha:") col.prop(mat.game_settings, "alpha_blend", text="") col = split.column(align=True) - col.label("Viewport Specular:") + col.label("Specular:") col.prop(mat, "specular_color", text="") col.prop(mat, "specular_hardness", text="Hardness") - col.separator() - col.prop(mat, "pass_index") - class CYCLES_TEXTURE_PT_context(CyclesButtonsPanel, Panel): bl_label = "" @@ -1803,6 +1819,7 @@ classes = ( CYCLES_MATERIAL_PT_volume, CYCLES_MATERIAL_PT_displacement, CYCLES_MATERIAL_PT_settings, + CYCLES_MATERIAL_PT_viewport, CYCLES_TEXTURE_PT_context, CYCLES_TEXTURE_PT_node, CYCLES_TEXTURE_PT_mapping, diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py index c105fe9036a..ec334c71555 100644 --- a/intern/cycles/blender/addon/version_update.py +++ b/intern/cycles/blender/addon/version_update.py @@ -360,3 +360,9 @@ def do_versions(self): if bpy.data.version <= (2, 79, 1) or \ (bpy.data.version >= (2, 80, 0) and bpy.data.version <= (2, 80, 3)): displacement_nodes_insert() + + if bpy.data.version <= (2, 79, 2): + for mat in bpy.data.materials: + cmat = mat.cycles + if not cmat.is_property_set("displacement_method"): + cmat.displacement_method = 'BUMP' diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index a82148788c8..22a3224e563 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -105,7 +105,8 @@ static int gpencil_editmode_toggle_exec(bContext *C, wmOperator *UNUSED(op)) ED_gpencil_reset_layers_parent(gpd); } - WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, NULL); + WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, NULL); + WM_event_add_notifier(C, NC_GPENCIL | ND_GPENCIL_EDITMODE, NULL); WM_event_add_notifier(C, NC_SCENE | ND_MODE, NULL); return OPERATOR_FINISHED; @@ -153,7 +154,8 @@ static int gpencil_hideselect_toggle_exec(bContext *C, wmOperator *UNUSED(op)) ts->gp_sculpt.alpha = 1.0f; } - WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, NULL); + WM_event_add_notifier(C, NC_GPENCIL | ND_DATA, NULL); + WM_event_add_notifier(C, NC_GPENCIL | ND_GPENCIL_EDITMODE, NULL); WM_event_add_notifier(C, NC_SCENE | ND_MODE, NULL); return OPERATOR_FINISHED; diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 6fdbe5e88a2..270ba2a7947 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -427,7 +427,8 @@ static int material_slot_move_exec(bContext *C, wmOperator *op) MEM_freeN(slot_remap); DEG_id_tag_update(&ob->id, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT | ND_DRAW | ND_DATA, ob); + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); + WM_event_add_notifier(C, NC_OBJECT | ND_DATA, ob); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 1c55a0d76cf..110c4d1789d 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -1127,7 +1127,8 @@ static int actkeys_select_leftright_exec(bContext *C, wmOperator *op) actkeys_select_leftright(&ac, leftright, selectmode); /* set notifier that keyframe selection (and channels too) have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL); return OPERATOR_FINISHED; } @@ -1577,7 +1578,8 @@ static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, const wmEvent mouse_action_keys(&ac, event->mval, selectmode, column, channel); /* set notifier that keyframe selection (and channels too) have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL); /* for tweak grab to work */ return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 1683fbdbdb9..392db4ef4b5 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -1003,7 +1003,8 @@ static int graphkeys_select_leftright_exec(bContext *C, wmOperator *op) graphkeys_select_leftright(&ac, leftright, selectmode); /* set notifier that keyframe selection (and channels too) have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL); return OPERATOR_FINISHED; } @@ -1517,7 +1518,8 @@ static int graphkeys_clickselect_invoke(bContext *C, wmOperator *op, const wmEve } /* set notifier that keyframe selection (and also channel selection in some cases) has changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL); /* for tweak grab to work */ return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH; diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 1179401f346..e09e4417d5d 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -444,7 +444,8 @@ static int nlaedit_select_leftright_exec(bContext *C, wmOperator *op) nlaedit_select_leftright(C, &ac, leftright, selectmode); /* set notifier that keyframe selection (and channels too) have changed */ - WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | ND_ANIMCHAN | NA_SELECTED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL); + WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL); return OPERATOR_FINISHED; } diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 261d9e2e159..5a5c99724fe 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -449,8 +449,6 @@ void RE_AcquireResultImage(Render *re, RenderResult *rr, const int view_id) rr->rectz = rv->rectz; rr->rect32 = rv->rect32; - rr->have_combined = (rv->rectf != NULL); - /* active layer */ rl = render_get_active_layer(re, re->result); @@ -861,7 +859,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, re->result = MEM_callocN(sizeof(RenderResult), "new render result"); re->result->rectx = re->rectx; re->result->recty = re->recty; - render_result_view_new(re->result, "new temporary view"); + render_result_view_new(re->result, ""); } if (re->r.scemode & R_VIEWPORT_PREVIEW) diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index 10920545b88..6749fedb16e 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -80,6 +80,8 @@ static void render_result_views_free(RenderResult *res) MEM_freeN(rv); } + + res->have_combined = false; } void render_result_free(RenderResult *res) @@ -1352,6 +1354,8 @@ void RE_render_result_rect_from_ibuf(RenderResult *rr, RenderData *UNUSED(rd), I RenderView *rv = RE_RenderViewGetById(rr, view_id); if (ibuf->rect_float) { + rr->have_combined = true; + if (!rv->rectf) rv->rectf = MEM_mallocN(4 * sizeof(float) * rr->rectx * rr->recty, "render_seq rectf"); @@ -1362,6 +1366,8 @@ void RE_render_result_rect_from_ibuf(RenderResult *rr, RenderData *UNUSED(rd), I MEM_SAFE_FREE(rv->rect32); } else if (ibuf->rect) { + rr->have_combined = true; + if (!rv->rect32) rv->rect32 = MEM_mallocN(sizeof(int) * rr->rectx * rr->recty, "render_seq rect"); |