diff options
author | Jacques Lucke <jacques@blender.org> | 2020-03-21 14:09:13 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-03-21 14:09:13 +0300 |
commit | 37ee4d4e2a0afb403f6f3a4a5898d2cfe2a339c7 (patch) | |
tree | bab6d76af3023860866fa0ea6e7f0a4ea5f2c4e5 /release/scripts | |
parent | d9356a5b8dfc9d63ffddc015c9e8a81db2a88b7e (diff) | |
parent | d924e31b421a51fed343fbd2a17291cfd289d9bc (diff) |
Merge branch 'master' into functions
Diffstat (limited to 'release/scripts')
9 files changed, 115 insertions, 50 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py index 61c3a8dd52c..cee8f89abd3 100644 --- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py +++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py @@ -765,7 +765,7 @@ def dump_src_messages(msgs, reports, settings): } data = "" - with open(path) as f: + with open(path, encoding="utf8") as f: data = f.read() for srch in pygettexts: m = srch(data) @@ -798,7 +798,7 @@ def dump_src_messages(msgs, reports, settings): forbidden = set() forced = set() if os.path.isfile(settings.SRC_POTFILES): - with open(settings.SRC_POTFILES) as src: + with open(settings.SRC_POTFILES, encoding="utf8") as src: for l in src: if l[0] == '-': forbidden.add(l[1:].rstrip('\n')) diff --git a/release/scripts/modules/bl_i18n_utils/settings.py b/release/scripts/modules/bl_i18n_utils/settings.py index e96c94d4f4e..4da9d515ffd 100644 --- a/release/scripts/modules/bl_i18n_utils/settings.py +++ b/release/scripts/modules/bl_i18n_utils/settings.py @@ -592,7 +592,7 @@ class I18nSettings: # Assume it is already real JSon string... self.from_json(fname) return - with open(fname) as f: + with open(fname, encoding="utf8") as f: self.from_json(f.read()) # Else assume fname is already a file(like) object! else: @@ -600,7 +600,7 @@ class I18nSettings: def save(self, fname): if isinstance(fname, str): - with open(fname, 'w') as f: + with open(fname, 'w', encoding="utf8") as f: f.write(self.to_json()) # Else assume fname is already a file(like) object! else: diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py index 7c22a86d687..493afc53267 100644 --- a/release/scripts/modules/bl_i18n_utils/utils.py +++ b/release/scripts/modules/bl_i18n_utils/utils.py @@ -1158,7 +1158,7 @@ class I18n: print("WARNING: skipping file {}, too huge!".format(path)) return None, None, None, False txt = "" - with open(path) as f: + with open(path, encoding="utf8") as f: txt = f.read() _in = 0 _out = len(txt) @@ -1544,7 +1544,7 @@ class I18n: "", self.settings.PARSER_PY_MARKER_END, ] - with open(dst, 'w') as f: + with open(dst, 'w', encoding="utf8") as f: f.write((prev or "") + "\n".join(txt) + (nxt or "")) self.unescape() diff --git a/release/scripts/modules/bl_i18n_utils/utils_languages_menu.py b/release/scripts/modules/bl_i18n_utils/utils_languages_menu.py index 4f499476ad9..7c98faebe9d 100755 --- a/release/scripts/modules/bl_i18n_utils/utils_languages_menu.py +++ b/release/scripts/modules/bl_i18n_utils/utils_languages_menu.py @@ -93,7 +93,7 @@ def gen_menu_file(stats, settings): else: # Non-existing, commented entry! data_lines.append("# {} #{}:{}:{}".format(FLAG_MESSAGES[flag], uid_num, label, uid)) - with open(os.path.join(settings.TRUNK_MO_DIR, settings.LANGUAGES_FILE), 'w') as f: + with open(os.path.join(settings.TRUNK_MO_DIR, settings.LANGUAGES_FILE), 'w', encoding="utf8") as f: f.write("\n".join(data_lines)) - with open(os.path.join(settings.GIT_I18N_ROOT, settings.LANGUAGES_FILE), 'w') as f: + with open(os.path.join(settings.GIT_I18N_ROOT, settings.LANGUAGES_FILE), 'w', encoding="utf8") as f: f.write("\n".join(data_lines)) diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py index d8501389204..15e526ea6a7 100644 --- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py +++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py @@ -3951,6 +3951,14 @@ def km_image_editor_tool_uv_select(params): ) +def km_3d_view_tool_edit_gpencil_select(params): + return ( + "3D View Tool: Edit Gpencil, Tweak", + {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, + {"items": _template_items_tool_select(params, "gpencil.select", extend="toggle")}, + ) + + # Fallback for gizmos that don't have custom a custom key-map. @@ -4088,6 +4096,7 @@ def generate_keymaps_impl(params=None): # Tool System. km_3d_view_tool_select(params), km_image_editor_tool_uv_select(params), + km_3d_view_tool_edit_gpencil_select(params), ] diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 0b2b8a730ce..46073e19fda 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -665,7 +665,19 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "offset_v") def MULTIRES(self, layout, ob, md): - layout.row().prop(md, "subdivision_type", expand=True) + # Changing some of the properties can not be done once there is an + # actual displacement stored for this multires modifier. This check + # will disallow those properties from change. + # This is a bit stupid check but should be sufficient for the usual + # multires usage. It might become less strict and only disallow + # modifications if there is CD_MDISPS layer, or if there is actual + # non-zero displacement but such checks will be too slow to be done + # on every redraw. + have_displacement = (md.total_levels != 0) + + row = layout.row() + row.enabled = not have_displacement + row.prop(md, "subdivision_type", expand=True) split = layout.split() col = split.column() @@ -673,7 +685,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): # TODO(sergey): Expose it again after T58473 is solved. # col.prop(md, "sculpt_levels", text="Sculpt") col.prop(md, "render_levels", text="Render") - col.prop(md, "quality") + + row = col.row() + row.enabled = not have_displacement + row.prop(md, "quality") col = split.column() @@ -2017,16 +2032,21 @@ class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel): split = layout.split() col = split.column() - col.prop(md, "normalize_opacity") - if md.normalize_opacity is True: - text="Strength" - else: - text="Opacity Factor" - - col.prop(md, "factor", text=text) col.prop(md, "modify_color") - self.gpencil_masking(layout, ob, md, True, True) + if md.modify_color == 'HARDENESS': + col.prop(md, "hardeness") + show = False + else: + col.prop(md, "normalize_opacity") + if md.normalize_opacity is True: + text="Strength" + else: + text="Opacity Factor" + + col.prop(md, "factor", text=text) + show = True + self.gpencil_masking(layout, ob, md, show, show) def GP_ARRAY(self, layout, ob, md): col = layout.column() diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index 65992a4e4e9..8d8070bad7a 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -173,7 +173,6 @@ class PHYSICS_PT_settings(PhysicButtonsPanel, Panel): col = flow.column() col.enabled = not domain.has_cache_baked_guide col.prop(domain, "resolution_max", text="Resolution Divisions") - col = flow.column() col.prop(domain, "time_scale", text="Time Scale") col.prop(domain, "cfl_condition", text="CFL Number") @@ -192,6 +191,8 @@ class PHYSICS_PT_settings(PhysicButtonsPanel, Panel): sub.prop(domain, "gravity", text="Using Scene Gravity", icon='SCENE_DATA') else: col.prop(domain, "gravity", text="Gravity") + + col = flow.column() col.prop(domain, "clipping", text="Empty Space") if domain.cache_type == 'MODULAR': @@ -421,14 +422,16 @@ class PHYSICS_PT_fire(PhysicButtonsPanel, Panel): col = flow.column() col.prop(domain, "burning_rate", text="Reaction Speed") - col = flow.column(align=True) - col.prop(domain, "flame_smoke", text="Flame Smoke") - col.prop(domain, "flame_vorticity", text="Vorticity") + row = col.row() + sub = row.column(align=True) + sub.prop(domain, "flame_smoke", text="Flame Smoke") + sub.prop(domain, "flame_vorticity", text="Vorticity") + col = flow.column(align=True) col.prop(domain, "flame_max_temp", text="Temperature Maximum") col.prop(domain, "flame_ignition", text="Minimum") - col = flow.column() - col.prop(domain, "flame_smoke_color", text="Flame Color") + row = col.row() + row.prop(domain, "flame_smoke_color", text="Flame Color") class PHYSICS_PT_liquid(PhysicButtonsPanel, Panel): @@ -468,21 +471,23 @@ class PHYSICS_PT_liquid(PhysicButtonsPanel, Panel): col = flow.column() col.prop(domain, "simulation_method", expand=False) col.prop(domain, "flip_ratio", text="FLIP Ratio") - col.prop(domain, "particle_radius", text="Particle Radius") + row = col.row() + sub = row.column(align=True) + sub.prop(domain, "particle_radius", text="Particle Radius") + sub.prop(domain, "particle_number", text="Sampling") + sub.prop(domain, "particle_randomness", text="Randomness") col = flow.column() - col.prop(domain, "particle_max", text="Particles Maximum") - col.prop(domain, "particle_min", text="Minimum") - - col = flow.column() - col.prop(domain, "particle_number", text="Particle Sampling") + row = col.row() + sub = row.column(align=True) + sub.prop(domain, "particle_max", text="Particles Maximum") + sub.prop(domain, "particle_min", text="Minimum") col.prop(domain, "particle_band_width", text="Narrow Band Width") - col.prop(domain, "particle_randomness", text="Particle Randomness") - - col = flow.column() - col.prop(domain, "use_fractions", text="Fractional Obstacles") - col.active = domain.use_fractions - col.prop(domain, "fractions_threshold", text="Obstacle-Fluid Threshold") + row = col.row() + sub = row.column(align=True) + sub.prop(domain, "use_fractions", text="Fractional Obstacles") + sub.active = domain.use_fractions + sub.prop(domain, "fractions_threshold", text="Obstacle-Fluid Threshold") class PHYSICS_PT_flow_source(PhysicButtonsPanel, Panel): @@ -1123,35 +1128,37 @@ class PHYSICS_PT_cache(PhysicButtonsPanel, Panel): col.prop(domain, "cache_type", expand=False) col.enabled = not is_baking_any - col = flow.column(align=True) col.separator() + row = col.row() + col = row.column(align=True) col.prop(domain, "cache_frame_start", text="Frame Start") col.prop(domain, "cache_frame_end", text="End") - col.enabled = not is_baking_any + row.enabled = not is_baking_any col.separator() col = flow.column() - col.enabled = not is_baking_any and not has_baked_data - col.prop(domain, "cache_data_format", text="Data File Format") + row = col.row() + row.enabled = not is_baking_any and not has_baked_data + row.prop(domain, "cache_data_format", text="Data File Format") if md.domain_settings.domain_type in {'GAS'}: if domain.use_noise: - col = flow.column() - col.enabled = not is_baking_any and not has_baked_noise - col.prop(domain, "cache_noise_format", text="Noise File Format") + row = col.row() + row.enabled = not is_baking_any and not has_baked_noise + row.prop(domain, "cache_noise_format", text="Noise File Format") if md.domain_settings.domain_type in {'LIQUID'}: # File format for all particle systemes (FLIP and secondary) - col = flow.column() - col.enabled = not is_baking_any and not has_baked_particles and not has_baked_data - col.prop(domain, "cache_particle_format", text="Particle File Format") + row = col.row() + row.enabled = not is_baking_any and not has_baked_particles and not has_baked_data + row.prop(domain, "cache_particle_format", text="Particle File Format") if domain.use_mesh: - col = flow.column() - col.enabled = not is_baking_any and not has_baked_mesh - col.prop(domain, "cache_mesh_format", text="Mesh File Format") + row = col.row() + row.enabled = not is_baking_any and not has_baked_mesh + row.prop(domain, "cache_mesh_format", text="Mesh File Format") if domain.cache_type == 'FINAL': diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index fa9778da53b..3d4c70e0143 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -294,7 +294,7 @@ class RENDER_PT_eevee_volumetric_shadows(RenderButtonsPanel, Panel): props = scene.eevee layout.active = props.use_volumetric_shadows - layout.prop(props, "volumetric_shadow_samples", text="Shadow Samples") + layout.prop(props, "volumetric_shadow_samples", text="Samples") class RENDER_PT_eevee_subsurface_scattering(RenderButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index defa3be6f9b..6f58886fe5d 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2943,6 +2943,32 @@ class VIEW3D_MT_gpencil_vertex_group(Menu): layout.operator("gpencil.vertex_group_deselect", text="Deselect") +class VIEW3D_MT_paint_weight_lock(Menu): + bl_label = "Vertex Group Locks" + + def draw(self, _context): + layout = self.layout + + op = layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All") + op.action, op.mask = 'LOCK', 'ALL' + op = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="Unlock All") + op.action, op.mask = 'UNLOCK', 'ALL' + op = layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock Selected") + op.action, op.mask = 'LOCK', 'SELECTED' + op = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="Unlock Selected") + op.action, op.mask = 'UNLOCK', 'SELECTED' + op = layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock Unselected") + op.action, op.mask = 'LOCK', 'UNSELECTED' + op = layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="Unlock Unselected") + op.action, op.mask = 'UNLOCK', 'UNSELECTED' + op = layout.operator("object.vertex_group_lock", text="Lock Only Selected") + op.action, op.mask = 'LOCK', 'INVERT_UNSELECTED' + op = layout.operator("object.vertex_group_lock", text="Lock Only Unselected") + op.action, op.mask = 'UNLOCK', 'INVERT_UNSELECTED' + op = layout.operator("object.vertex_group_lock", text="Invert Locks") + op.action, op.mask = 'INVERT', 'ALL' + + class VIEW3D_MT_paint_weight(Menu): bl_label = "Weights" @@ -2984,6 +3010,8 @@ class VIEW3D_MT_paint_weight(Menu): layout.operator("paint.weight_set") + layout.menu("VIEW3D_MT_paint_weight_lock", text="Locks") + def draw(self, _context): self.draw_generic(self.layout, is_editmode=False) @@ -7306,6 +7334,7 @@ classes = ( VIEW3D_MT_vertex_group, VIEW3D_MT_gpencil_vertex_group, VIEW3D_MT_paint_weight, + VIEW3D_MT_paint_weight_lock, VIEW3D_MT_sculpt, VIEW3D_MT_sculpt_set_pivot, VIEW3D_MT_mask, |