diff options
Diffstat (limited to 'release')
77 files changed, 1178 insertions, 731 deletions
diff --git a/release/datafiles/blender_icons.svg b/release/datafiles/blender_icons.svg index 4d5376913ab..7379dee3573 100644 --- a/release/datafiles/blender_icons.svg +++ b/release/datafiles/blender_icons.svg @@ -31910,6 +31910,117 @@ id="radialGradient16215" xlink:href="#linearGradient18134" inkscape:collect="always" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient27277-1-8" + id="linearGradient18811" + gradientUnits="userSpaceOnUse" + x1="4.1933641" + y1="199.12067" + x2="17.16466" + y2="211.01585" /> + <mask + maskUnits="userSpaceOnUse" + id="mask25369-1"> + <g + id="g25371-3" + transform="translate(-21,-21)"> + <path + inkscape:connector-curvature="0" + style="fill:url(#linearGradient25381);fill-rule:evenodd;stroke:none" + d="m 341,302 8,8 -8,8 z" + id="path25373-1" + sodipodi:nodetypes="cccc" + inkscape:transform-center-x="4" /> + <path + inkscape:connector-curvature="0" + inkscape:transform-center-y="-4" + sodipodi:nodetypes="cccc" + id="path25375-1" + d="m 357,302 -8,8 -8,-8 z" + style="fill:url(#linearGradient25383-9);fill-rule:evenodd;stroke:none" /> + <path + inkscape:connector-curvature="0" + inkscape:transform-center-x="-4" + sodipodi:nodetypes="cccc" + id="path25377-0" + d="m 357,318 -8,-8 8,-8 z" + style="fill:url(#linearGradient25385-1);fill-rule:evenodd;stroke:none" /> + <path + inkscape:connector-curvature="0" + inkscape:transform-center-y="4" + sodipodi:nodetypes="cccc" + id="path25379-3" + d="m 341,318 8,-8 8,8 z" + style="fill:url(#linearGradient25387-9);fill-rule:evenodd;stroke:none" /> + </g> + </mask> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient16595" + id="linearGradient25383-9" + gradientUnits="userSpaceOnUse" + gradientTransform="rotate(90,339,299)" + x1="342" + y1="288.5" + x2="344.5" + y2="288.5" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient16595" + id="linearGradient25385-1" + gradientUnits="userSpaceOnUse" + gradientTransform="rotate(180,349.5,299.5)" + x1="342" + y1="288.5" + x2="344.5" + y2="288.5" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient16595" + id="linearGradient25387-9" + gradientUnits="userSpaceOnUse" + gradientTransform="rotate(-90,360,300)" + x1="342" + y1="288.5" + x2="344.5" + y2="288.5" /> + <mask + maskUnits="userSpaceOnUse" + id="mask25369-1-6"> + <g + id="g25371-3-4" + transform="translate(-21,-21)"> + <path + inkscape:connector-curvature="0" + style="fill:url(#linearGradient25381);fill-rule:evenodd;stroke:none" + d="m 341,302 8,8 -8,8 z" + id="path25373-1-0" + sodipodi:nodetypes="cccc" + inkscape:transform-center-x="4" /> + <path + inkscape:connector-curvature="0" + inkscape:transform-center-y="-4" + sodipodi:nodetypes="cccc" + id="path25375-1-0" + d="m 357,302 -8,8 -8,-8 z" + style="fill:url(#linearGradient25383-9);fill-rule:evenodd;stroke:none" /> + <path + inkscape:connector-curvature="0" + inkscape:transform-center-x="-4" + sodipodi:nodetypes="cccc" + id="path25377-0-4" + d="m 357,318 -8,-8 8,-8 z" + style="fill:url(#linearGradient25385-1);fill-rule:evenodd;stroke:none" /> + <path + inkscape:connector-curvature="0" + inkscape:transform-center-y="4" + sodipodi:nodetypes="cccc" + id="path25379-3-6" + d="m 341,318 8,-8 8,8 z" + style="fill:url(#linearGradient25387-9);fill-rule:evenodd;stroke:none" /> + </g> + </mask> </defs> <sodipodi:namedview id="base" @@ -92657,6 +92768,135 @@ y="75.5" /> </g> </g> + <g + transform="translate(461.71013,377.29483)" + style="display:inline;enable-background:new" + id="ICON_SOLO_OFF-7"> + <rect + y="198.9792" + x="4.9506397" + height="16" + width="16" + id="rect23018-5-4-5" + style="display:inline;overflow:visible;visibility:visible;opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;enable-background:accumulate" /> + <g + transform="matrix(0.94058502,0,0,0.94058502,0.9128606,12.74924)" + id="g56716-3" /> + </g> + <g + transform="translate(461.99301,376.87052)" + style="display:inline;enable-background:new" + id="ICON_SOLO_OFF-1"> + <rect + y="198.9792" + x="4.9506397" + height="16" + width="16" + id="rect23018-5-4-2" + style="display:inline;overflow:visible;visibility:visible;opacity:0;fill:#b3b3b3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.79999995;marker:none;enable-background:accumulate" /> + <g + transform="matrix(0.94058502,0,0,0.94058502,0.9128606,12.74924)" + id="g56716-7"> + <path + sodipodi:type="star" + style="fill:url(#linearGradient18811);fill-opacity:1.0;stroke:#000000;stroke-width:0.96882826;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.80000001" + id="path15855-0" + sodipodi:sides="5" + sodipodi:cx="13.700194" + sodipodi:cy="207.20645" + sodipodi:r1="7.1873641" + sodipodi:r2="3.3158474" + sodipodi:arg1="0.94697287" + sodipodi:arg2="1.5618338" + inkscape:flatsided="false" + inkscape:rounded="0" + inkscape:randomized="0" + d="m 17.898641,213.04008 -4.168729,-2.51791 -4.280439,2.47993 1.106473,-4.74277 -3.6812884,-3.3046 4.8525664,-0.41328 2.005278,-4.52229 1.892578,4.48735 4.920618,0.50967 -3.682889,3.18662 z" + inkscape:transform-center-x="-0.010954063" + inkscape:transform-center-y="-0.74285516" + transform="matrix(1.0972098,0,0,1.0975406,-2.0923019,-19.740595)" /> + <path + style="fill:none;stroke:#ffffff;stroke-width:1.06316817;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:0.51147538" + d="m 12.931855,202.51514 -1.201334,2.70994 c -0.137665,0.32193 -0.454082,0.55986 -0.800889,0.60222 l -2.9032248,0.26765 2.2358168,1.97391 c 0.261321,0.2395 0.380487,0.62447 0.300333,0.97022 l -0.667408,2.81032" + id="path15869-9" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccccc" /> + </g> + </g> + <g + style="display:inline;enable-background:new" + transform="translate(168.01766,170.03707)" + id="ICON_GRID-3" + mask="url(#mask25369-1)"> + <rect + y="281" + x="320" + height="16" + width="16" + id="rect36193-3" + style="display:inline;overflow:visible;visibility:visible;opacity:0.01000001;fill:#cccccc;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.70000005;marker:none;enable-background:accumulate" /> + <path + sodipodi:nodetypes="cccc" + d="m 324.5,295.75 v -13.5 m 7,13.5 v -13.5" + style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path36195-8" + inkscape:connector-curvature="0" /> + <path + id="path36197-0" + style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 321.25001,285.50001 334.75,285.5 M 321.25001,292.50001 334.75,292.5" + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" /> + <path + id="path36199-5" + style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 324.5,296.5 v -14.99999 m 7,14.99999 v -14.99999" + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" /> + <path + sodipodi:nodetypes="cccc" + d="m 320.5,285.50001 h 15 m -15,6.99999 h 15" + style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path36201-6" + inkscape:connector-curvature="0" /> + </g> + <g + style="display:inline;enable-background:new;opacity:0.25" + transform="translate(188.9552,170.08067)" + id="ICON_GRID-3-7" + mask="url(#mask25369-1-6)"> + <rect + y="281" + x="320" + height="16" + width="16" + id="rect36193-3-2" + style="display:inline;overflow:visible;visibility:visible;opacity:0.01000001;fill:#cccccc;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.70000005;marker:none;enable-background:accumulate" /> + <path + sodipodi:nodetypes="cccc" + d="m 324.5,295.75 v -13.5 m 7,13.5 v -13.5" + style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path36195-8-8" + inkscape:connector-curvature="0" /> + <path + id="path36197-0-2" + style="fill:#ffffff;fill-rule:evenodd;stroke:#000000;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 321.25001,285.50001 334.75,285.5 M 321.25001,292.50001 334.75,292.5" + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" /> + <path + id="path36199-5-9" + style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 324.5,296.5 v -14.99999 m 7,14.99999 v -14.99999" + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" /> + <path + sodipodi:nodetypes="cccc" + d="m 320.5,285.50001 h 15 m -15,6.99999 h 15" + style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path36201-6-9" + inkscape:connector-curvature="0" /> + </g> </g> <g inkscape:groupmode="layer" diff --git a/release/datafiles/blender_icons16/icon16_hide_off.dat b/release/datafiles/blender_icons16/icon16_hide_off.dat Binary files differnew file mode 100644 index 00000000000..4feb0d26696 --- /dev/null +++ b/release/datafiles/blender_icons16/icon16_hide_off.dat diff --git a/release/datafiles/blender_icons16/icon16_hide_on.dat b/release/datafiles/blender_icons16/icon16_hide_on.dat Binary files differnew file mode 100644 index 00000000000..906edb431dd --- /dev/null +++ b/release/datafiles/blender_icons16/icon16_hide_on.dat diff --git a/release/datafiles/blender_icons16/icon16_preset.dat b/release/datafiles/blender_icons16/icon16_preset.dat Binary files differnew file mode 100644 index 00000000000..52026e95a1a --- /dev/null +++ b/release/datafiles/blender_icons16/icon16_preset.dat diff --git a/release/datafiles/blender_icons16/icon16_restrict_view_off.dat b/release/datafiles/blender_icons16/icon16_restrict_view_off.dat Binary files differindex 730f5749104..320c1be5259 100644 --- a/release/datafiles/blender_icons16/icon16_restrict_view_off.dat +++ b/release/datafiles/blender_icons16/icon16_restrict_view_off.dat diff --git a/release/datafiles/blender_icons16/icon16_restrict_view_on.dat b/release/datafiles/blender_icons16/icon16_restrict_view_on.dat Binary files differindex edef3a356b2..279d744a012 100644 --- a/release/datafiles/blender_icons16/icon16_restrict_view_on.dat +++ b/release/datafiles/blender_icons16/icon16_restrict_view_on.dat diff --git a/release/datafiles/blender_icons32/icon32_hide_off.dat b/release/datafiles/blender_icons32/icon32_hide_off.dat Binary files differnew file mode 100644 index 00000000000..e13dd195ee6 --- /dev/null +++ b/release/datafiles/blender_icons32/icon32_hide_off.dat diff --git a/release/datafiles/blender_icons32/icon32_hide_on.dat b/release/datafiles/blender_icons32/icon32_hide_on.dat Binary files differnew file mode 100644 index 00000000000..25c83fb165d --- /dev/null +++ b/release/datafiles/blender_icons32/icon32_hide_on.dat diff --git a/release/datafiles/blender_icons32/icon32_preset.dat b/release/datafiles/blender_icons32/icon32_preset.dat Binary files differnew file mode 100644 index 00000000000..57d5d2536f1 --- /dev/null +++ b/release/datafiles/blender_icons32/icon32_preset.dat diff --git a/release/datafiles/blender_icons32/icon32_restrict_view_off.dat b/release/datafiles/blender_icons32/icon32_restrict_view_off.dat Binary files differindex f9b3a48cfde..ec850df393e 100644 --- a/release/datafiles/blender_icons32/icon32_restrict_view_off.dat +++ b/release/datafiles/blender_icons32/icon32_restrict_view_off.dat diff --git a/release/datafiles/blender_icons32/icon32_restrict_view_on.dat b/release/datafiles/blender_icons32/icon32_restrict_view_on.dat Binary files differindex 482530bab58..07e66cc51a9 100644 --- a/release/datafiles/blender_icons32/icon32_restrict_view_on.dat +++ b/release/datafiles/blender_icons32/icon32_restrict_view_on.dat diff --git a/release/datafiles/blender_icons_geom.py b/release/datafiles/blender_icons_geom.py index e9155a91fc8..bb7a6568767 100644 --- a/release/datafiles/blender_icons_geom.py +++ b/release/datafiles/blender_icons_geom.py @@ -288,7 +288,7 @@ def main(): objects = [] if args.group: - group = bpy.data.groups.get(args.group) + group = bpy.data.collections.get(args.group) if group is None: print(f"Group {args.group!r} not found!") return diff --git a/release/datafiles/colormanagement/config.ocio b/release/datafiles/colormanagement/config.ocio index 71223ea828e..ce79dfeb540 100644 --- a/release/datafiles/colormanagement/config.ocio +++ b/release/datafiles/colormanagement/config.ocio @@ -40,6 +40,9 @@ roles: # Non-color data data: Non-Color + # CIE XYZ color space + XYZ: XYZ + displays: sRGB: - !<View> {name: Default, colorspace: sRGB} @@ -188,8 +191,7 @@ colorspaces: allocationvars: [-8.5, 5] from_reference: !<GroupTransform> children: - - !<FileTransform> {src: rec709_to_aces.spimtx, interpolation: linear} - - !<FileTransform> {src: aces_to_xyz.spimtx, interpolation: linear} + - !<FileTransform> {src: srgb_to_xyz.spimtx, interpolation: linear} - !<ColorSpace> name: rrt_xyz diff --git a/release/datafiles/matcaps/license.txt b/release/datafiles/matcaps/license.txt deleted file mode 100644 index 358c8dcd832..00000000000 --- a/release/datafiles/matcaps/license.txt +++ /dev/null @@ -1,3 +0,0 @@ -These matcap images are licensed as GNU GPL 2 or later, like the rest of Blender's code. - -Thanks to Kent Trammell, Aidy Burrows, John Herreno , Terry Wallwork and David Silverman for making the pictures. diff --git a/release/datafiles/matcaps/mc01.jpg b/release/datafiles/matcaps/mc01.jpg Binary files differdeleted file mode 100644 index 8c7aef287ee..00000000000 --- a/release/datafiles/matcaps/mc01.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc02.jpg b/release/datafiles/matcaps/mc02.jpg Binary files differdeleted file mode 100644 index 11deddfeaed..00000000000 --- a/release/datafiles/matcaps/mc02.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc03.jpg b/release/datafiles/matcaps/mc03.jpg Binary files differdeleted file mode 100644 index 64d992fb61a..00000000000 --- a/release/datafiles/matcaps/mc03.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc04.jpg b/release/datafiles/matcaps/mc04.jpg Binary files differdeleted file mode 100644 index 42be580ee93..00000000000 --- a/release/datafiles/matcaps/mc04.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc05.jpg b/release/datafiles/matcaps/mc05.jpg Binary files differdeleted file mode 100644 index 586d233ef31..00000000000 --- a/release/datafiles/matcaps/mc05.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc06.jpg b/release/datafiles/matcaps/mc06.jpg Binary files differdeleted file mode 100644 index 657883d0866..00000000000 --- a/release/datafiles/matcaps/mc06.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc07.jpg b/release/datafiles/matcaps/mc07.jpg Binary files differdeleted file mode 100644 index 372caf7e87c..00000000000 --- a/release/datafiles/matcaps/mc07.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc08.jpg b/release/datafiles/matcaps/mc08.jpg Binary files differdeleted file mode 100644 index 50eec402812..00000000000 --- a/release/datafiles/matcaps/mc08.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc09.jpg b/release/datafiles/matcaps/mc09.jpg Binary files differdeleted file mode 100644 index e05d441aaf9..00000000000 --- a/release/datafiles/matcaps/mc09.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc10.jpg b/release/datafiles/matcaps/mc10.jpg Binary files differdeleted file mode 100644 index ab82f17bb93..00000000000 --- a/release/datafiles/matcaps/mc10.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc11.jpg b/release/datafiles/matcaps/mc11.jpg Binary files differdeleted file mode 100644 index 053550f082c..00000000000 --- a/release/datafiles/matcaps/mc11.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc12.jpg b/release/datafiles/matcaps/mc12.jpg Binary files differdeleted file mode 100644 index beb16f3742e..00000000000 --- a/release/datafiles/matcaps/mc12.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc13.jpg b/release/datafiles/matcaps/mc13.jpg Binary files differdeleted file mode 100644 index 7fb8fa58e8f..00000000000 --- a/release/datafiles/matcaps/mc13.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc14.jpg b/release/datafiles/matcaps/mc14.jpg Binary files differdeleted file mode 100644 index ba868d2f95a..00000000000 --- a/release/datafiles/matcaps/mc14.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc15.jpg b/release/datafiles/matcaps/mc15.jpg Binary files differdeleted file mode 100644 index b10ea326a42..00000000000 --- a/release/datafiles/matcaps/mc15.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc16.jpg b/release/datafiles/matcaps/mc16.jpg Binary files differdeleted file mode 100644 index c6ce02d59df..00000000000 --- a/release/datafiles/matcaps/mc16.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc17.jpg b/release/datafiles/matcaps/mc17.jpg Binary files differdeleted file mode 100644 index 14f15f70460..00000000000 --- a/release/datafiles/matcaps/mc17.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc18.jpg b/release/datafiles/matcaps/mc18.jpg Binary files differdeleted file mode 100644 index db572856b07..00000000000 --- a/release/datafiles/matcaps/mc18.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc19.jpg b/release/datafiles/matcaps/mc19.jpg Binary files differdeleted file mode 100644 index 56d2efb1734..00000000000 --- a/release/datafiles/matcaps/mc19.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc20.jpg b/release/datafiles/matcaps/mc20.jpg Binary files differdeleted file mode 100644 index 002a0910dd9..00000000000 --- a/release/datafiles/matcaps/mc20.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc21.jpg b/release/datafiles/matcaps/mc21.jpg Binary files differdeleted file mode 100644 index cb2fea573b8..00000000000 --- a/release/datafiles/matcaps/mc21.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc22.jpg b/release/datafiles/matcaps/mc22.jpg Binary files differdeleted file mode 100644 index 2fc71b98c5a..00000000000 --- a/release/datafiles/matcaps/mc22.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc23.jpg b/release/datafiles/matcaps/mc23.jpg Binary files differdeleted file mode 100644 index 3793c0fcaa5..00000000000 --- a/release/datafiles/matcaps/mc23.jpg +++ /dev/null diff --git a/release/datafiles/matcaps/mc24.jpg b/release/datafiles/matcaps/mc24.jpg Binary files differdeleted file mode 100644 index 2a9618d8fe1..00000000000 --- a/release/datafiles/matcaps/mc24.jpg +++ /dev/null diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 3a9704b12e9..6cca60bd49e 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -856,7 +856,8 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta): def path_menu(self, searchpaths, operator, *, props_default=None, prop_filepath="filepath", - filter_ext=None, filter_path=None, display_name=None): + filter_ext=None, filter_path=None, display_name=None, + add_operator=None): """ Populate a menu from a list of paths. @@ -902,12 +903,16 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta): files.sort() + col = layout.column(align=True) + for f, filepath in files: # Intentionally pass the full path to 'display_name' callback, # since the callback may want to use part a directory in the name. - props = layout.operator( + row = col.row(align=True) + name = display_name(filepath) if display_name else bpy.path.display_name(f) + props = row.operator( operator, - text=display_name(filepath) if display_name else bpy.path.display_name(f), + text=name, translate=False, ) @@ -919,6 +924,25 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta): if operator == "script.execute_preset": props.menu_idname = self.bl_idname + if add_operator: + props = row.operator(add_operator, text="", icon='ZOOMOUT') + props.name = name + props.remove_name = True + + if add_operator: + wm = bpy.data.window_managers[0] + + layout.separator() + row = layout.row() + + sub = row.row() + sub.emboss = 'NORMAL' + sub.prop(wm, "preset_name", text="") + + props = row.operator(add_operator, text="", icon='ZOOMIN') + props.name = wm.preset_name + + def draw_preset(self, context): """ Define these on the subclass: @@ -926,16 +950,19 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta): - preset_subdir (string) Optionally: + - preset_add_operator (string) - preset_extensions (set of strings) - preset_operator_defaults (dict of keyword args) """ import bpy ext_valid = getattr(self, "preset_extensions", {".py", ".xml"}) props_default = getattr(self, "preset_operator_defaults", None) + add_operator = getattr(self, "preset_add_operator", None) self.path_menu(bpy.utils.preset_paths(self.preset_subdir), self.preset_operator, props_default=props_default, - filter_ext=lambda ext: ext.lower() in ext_valid) + filter_ext=lambda ext: ext.lower() in ext_valid, + add_operator=add_operator) @classmethod def draw_collapsible(cls, context, layout): diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index deca40909ae..5c1ca0ab2ad 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -19,9 +19,15 @@ # <pep8 compliant> import bpy -from bpy.types import Menu, Operator +from bpy.types import Menu, Operator, Panel, WindowManager from bpy.props import StringProperty, BoolProperty +# For preset popover menu +WindowManager.preset_name = StringProperty( + name="Preset Name", + description="Name for new preset", + default="New Preset" +) class AddPresetBase: """Base preset class, only for subclassing @@ -40,6 +46,10 @@ class AddPresetBase: maxlen=64, options={'SKIP_SAVE'}, ) + remove_name = BoolProperty( + default=False, + options={'HIDDEN', 'SKIP_SAVE'}, + ) remove_active = BoolProperty( default=False, options={'HIDDEN', 'SKIP_SAVE'}, @@ -48,6 +58,7 @@ class AddPresetBase: # needed for mix-ins order = [ "name", + "remove_name", "remove_active", ] @@ -85,11 +96,17 @@ class AddPresetBase: else: ext = ".py" - if not self.remove_active: - name = self.name.strip() + name = self.name.strip() + if not (self.remove_name or self.remove_active): + if not name: return {'FINISHED'} + # Reset preset name + wm = bpy.data.window_managers[0] + if name == wm.preset_name: + wm.preset_name = 'New Preset' + filename = self.as_filename(name) target_path = os.path.join("presets", self.preset_subdir) @@ -155,15 +172,16 @@ class AddPresetBase: preset_menu_class.bl_label = bpy.path.display_name(filename) else: - preset_active = preset_menu_class.bl_label + if self.remove_active: + name = preset_menu_class.bl_label # fairly sloppy but convenient. - filepath = bpy.utils.preset_find(preset_active, + filepath = bpy.utils.preset_find(name, self.preset_subdir, ext=ext) if not filepath: - filepath = bpy.utils.preset_find(preset_active, + filepath = bpy.utils.preset_find(name, self.preset_subdir, display_name=True, ext=ext) @@ -194,7 +212,7 @@ class AddPresetBase: self.name = self.as_filename(self.name.strip()) def invoke(self, context, event): - if not self.remove_active: + if not (self.remove_active or self.remove_name): wm = context.window_manager return wm.invoke_props_dialog(self) else: @@ -241,11 +259,45 @@ class ExecutePreset(Operator): return {'FINISHED'} +class PresetMenu(Panel): + bl_space_type = 'PROPERTIES' + bl_region_type = 'HEADER' + bl_label = "Presets" + path_menu = Menu.path_menu + + @classmethod + def draw_panel_header(cls, layout): + layout.emboss = 'NONE' + layout.popover(cls.bl_space_type, + cls.bl_region_type, + cls.__name__, + icon='PRESET', + text='') + + @classmethod + def draw_menu(cls, layout, text=None): + if text == None: + text = cls.bl_label + + layout.popover(cls.bl_space_type, + cls.bl_region_type, + cls.__name__, + icon='PRESET', + text=text) + + def draw(self, context): + layout = self.layout + layout.emboss = 'PULLDOWN_MENU' + layout.operator_context = 'EXEC_DEFAULT' + + Menu.draw_preset(self, context) + + class AddPresetRender(AddPresetBase, Operator): """Add or remove a Render Preset""" bl_idname = "render.preset_add" bl_label = "Add Render Preset" - preset_menu = "RENDER_MT_presets" + preset_menu = "RENDER_PT_presets" preset_defines = [ "scene = bpy.context.scene" @@ -268,7 +320,7 @@ class AddPresetCamera(AddPresetBase, Operator): """Add or remove a Camera Preset""" bl_idname = "camera.preset_add" bl_label = "Add Camera Preset" - preset_menu = "CAMERA_MT_presets" + preset_menu = "CAMERA_PT_presets" preset_defines = [ "cam = bpy.context.camera" @@ -299,7 +351,7 @@ class AddPresetSafeAreas(AddPresetBase, Operator): """Add or remove a Safe Areas Preset""" bl_idname = "safe_areas.preset_add" bl_label = "Add Safe Area Preset" - preset_menu = "SAFE_AREAS_MT_presets" + preset_menu = "SAFE_AREAS_PT_presets" preset_defines = [ "safe_areas = bpy.context.scene.safe_areas" @@ -319,7 +371,7 @@ class AddPresetCloth(AddPresetBase, Operator): """Add or remove a Cloth Preset""" bl_idname = "cloth.preset_add" bl_label = "Add Cloth Preset" - preset_menu = "CLOTH_MT_presets" + preset_menu = "CLOTH_PT_presets" preset_defines = [ "cloth = bpy.context.cloth" @@ -341,7 +393,7 @@ class AddPresetFluid(AddPresetBase, Operator): """Add or remove a Fluid Preset""" bl_idname = "fluid.preset_add" bl_label = "Add Fluid Preset" - preset_menu = "FLUID_MT_presets" + preset_menu = "FLUID_PT_presets" preset_defines = [ "fluid = bpy.context.fluid" @@ -359,7 +411,7 @@ class AddPresetHairDynamics(AddPresetBase, Operator): """Add or remove a Hair Dynamics Preset""" bl_idname = "particle.hair_dynamics_preset_add" bl_label = "Add Hair Dynamics Preset" - preset_menu = "PARTICLE_MT_hair_dynamics_presets" + preset_menu = "PARTICLE_PT_hair_dynamics_presets" preset_defines = [ "psys = bpy.context.particle_system", @@ -385,35 +437,6 @@ class AddPresetHairDynamics(AddPresetBase, Operator): ] -class AddPresetSunSky(AddPresetBase, Operator): - """Add or remove a Sky & Atmosphere Preset""" - bl_idname = "lamp.sunsky_preset_add" - bl_label = "Add Sunsky Preset" - preset_menu = "LAMP_MT_sunsky_presets" - - preset_defines = [ - "sky = bpy.context.lamp.sky" - ] - - preset_values = [ - "sky.atmosphere_extinction", - "sky.atmosphere_inscattering", - "sky.atmosphere_turbidity", - "sky.backscattered_light", - "sky.horizon_brightness", - "sky.spread", - "sky.sun_brightness", - "sky.sun_intensity", - "sky.sun_size", - "sky.sky_blend", - "sky.sky_blend_type", - "sky.sky_color_space", - "sky.sky_exposure", - ] - - preset_subdir = "sunsky" - - class AddPresetInteraction(AddPresetBase, Operator): """Add or remove an Application Interaction Preset""" bl_idname = "wm.interaction_preset_add" @@ -444,7 +467,7 @@ class AddPresetTrackingCamera(AddPresetBase, Operator): """Add or remove a Tracking Camera Intrinsics Preset""" bl_idname = "clip.camera_preset_add" bl_label = "Add Camera Preset" - preset_menu = "CLIP_MT_camera_presets" + preset_menu = "CLIP_PT_camera_presets" preset_defines = [ "camera = bpy.context.edit_movieclip.tracking.camera" @@ -478,7 +501,7 @@ class AddPresetTrackingTrackColor(AddPresetBase, Operator): """Add or remove a Clip Track Color Preset""" bl_idname = "clip.track_color_preset_add" bl_label = "Add Track Color Preset" - preset_menu = "CLIP_MT_track_color_presets" + preset_menu = "CLIP_PT_track_color_presets" preset_defines = [ "track = bpy.context.edit_movieclip.tracking.tracks.active" @@ -496,7 +519,7 @@ class AddPresetTrackingSettings(AddPresetBase, Operator): """Add or remove a motion tracking settings preset""" bl_idname = "clip.tracking_settings_preset_add" bl_label = "Add Tracking Settings Preset" - preset_menu = "CLIP_MT_tracking_settings_presets" + preset_menu = "CLIP_PT_tracking_settings_presets" preset_defines = [ "settings = bpy.context.edit_movieclip.tracking.settings" @@ -526,7 +549,7 @@ class AddPresetNodeColor(AddPresetBase, Operator): """Add or remove a Node Color Preset""" bl_idname = "node.node_color_preset_add" bl_label = "Add Node Color Preset" - preset_menu = "NODE_MT_node_color_presets" + preset_menu = "NODE_PT_node_color_presets" preset_defines = [ "node = bpy.context.active_node" @@ -639,7 +662,7 @@ class AddPresetUnitsLength(AddPresetBase, Operator): """Add or remove length units preset""" bl_idname = "scene.units_length_preset_add" bl_label = "Add Length Units Preset" - preset_menu = "SCENE_MT_units_length_presets" + preset_menu = "SCENE_PT_units_length_presets" preset_defines = [ "scene = bpy.context.scene" @@ -665,7 +688,6 @@ classes = ( AddPresetOperator, AddPresetRender, AddPresetSafeAreas, - AddPresetSunSky, AddPresetTrackingCamera, AddPresetTrackingSettings, AddPresetTrackingTrackColor, diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index e58b4f56ffe..6cfc4b6ea3f 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -328,7 +328,7 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from class DATA_PT_custom_props_arm(ArmatureButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _context_path = "object.data" _property_type = bpy.types.Armature diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py index 079669dbd02..cc593fbb0a2 100644 --- a/release/scripts/startup/bl_ui/properties_data_bone.py +++ b/release/scripts/startup/bl_ui/properties_data_bone.py @@ -402,7 +402,7 @@ class BONE_PT_deform(BoneButtonsPanel, Panel): class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _property_type = bpy.types.Bone, bpy.types.EditBone, bpy.types.PoseBone @property diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py index e81fc393af8..10709676b85 100644 --- a/release/scripts/startup/bl_ui/properties_data_camera.py +++ b/release/scripts/startup/bl_ui/properties_data_camera.py @@ -20,6 +20,7 @@ import bpy from bpy.types import Panel, Menu from rna_prop_ui import PropertyPanel +from bl_operators.presets import PresetMenu class CameraButtonsPanel: @@ -33,26 +34,26 @@ class CameraButtonsPanel: return context.camera and (engine in cls.COMPAT_ENGINES) -class CAMERA_MT_presets(Menu): +class CAMERA_PT_presets(PresetMenu): bl_label = "Camera Presets" preset_subdir = "camera" preset_operator = "script.execute_preset" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} - draw = Menu.draw_preset + preset_add_operator = "camera.preset_add" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} -class SAFE_AREAS_MT_presets(Menu): +class SAFE_AREAS_PT_presets(PresetMenu): bl_label = "Camera Presets" preset_subdir = "safe_areas" preset_operator = "script.execute_preset" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} - draw = Menu.draw_preset + preset_add_operator = "safe_areas.preset_add" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} class DATA_PT_context_camera(CameraButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -72,7 +73,7 @@ class DATA_PT_context_camera(CameraButtonsPanel, Panel): class DATA_PT_lens(CameraButtonsPanel, Panel): bl_label = "Lens" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -113,7 +114,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel): sub = col.column(align=True) sub.prop(ccam, "longitude_min", text="Longiture Min") sub.prop(ccam, "longitude_max", text="Max") - elif engine in {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'}: + elif engine in {'BLENDER_RENDER', 'BLENDER_EEVEE'}: if cam.lens_unit == 'MILLIMETERS': col.prop(cam, "lens") elif cam.lens_unit == 'FOV': @@ -135,7 +136,7 @@ class DATA_PT_lens(CameraButtonsPanel, Panel): class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel): bl_label = "Stereoscopy" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -183,19 +184,16 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel): class DATA_PT_camera(CameraButtonsPanel, Panel): bl_label = "Camera" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + + def draw_header_preset(self, context): + CAMERA_PT_presets.draw_panel_header(self.layout) def draw(self, context): layout = self.layout cam = context.camera - row = layout.row(align=True) - - row.menu("CAMERA_MT_presets", text=bpy.types.CAMERA_MT_presets.bl_label) - row.operator("camera.preset_add", text="", icon='ZOOMIN') - row.operator("camera.preset_add", text="", icon='ZOOMOUT').remove_active = True - layout.use_property_split = True col = layout.column() @@ -216,7 +214,7 @@ class DATA_PT_camera(CameraButtonsPanel, Panel): class DATA_PT_camera_dof(CameraButtonsPanel, Panel): bl_label = "Depth of Field" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -235,7 +233,7 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel): class DATA_PT_camera_dof_aperture(CameraButtonsPanel, Panel): bl_label = "Aperture" bl_parent_id = "DATA_PT_camera_dof" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -269,7 +267,7 @@ class DATA_PT_camera_dof_aperture(CameraButtonsPanel, Panel): class DATA_PT_camera_background_image(CameraButtonsPanel, Panel): bl_label = "Background Images" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw_header(self, context): cam = context.camera @@ -370,7 +368,7 @@ class DATA_PT_camera_background_image(CameraButtonsPanel, Panel): class DATA_PT_camera_display(CameraButtonsPanel, Panel): bl_label = "Display" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -403,13 +401,16 @@ class DATA_PT_camera_display(CameraButtonsPanel, Panel): class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel): bl_label = "Safe Areas" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw_header(self, context): cam = context.camera self.layout.prop(cam, "show_safe_areas", text="") + def draw_header_preset(self, context): + SAFE_AREAS_PT_presets.draw_panel_header(self.layout) + def draw(self, context): layout = self.layout safe_data = context.scene.safe_areas @@ -419,7 +420,7 @@ class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel): class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _context_path = "object.data" _property_type = bpy.types.Camera @@ -430,13 +431,6 @@ def draw_display_safe_settings(layout, safe_data, settings): layout.use_property_split = True - row = layout.row(align=True) - row.menu("SAFE_AREAS_MT_presets", text=bpy.types.SAFE_AREAS_MT_presets.bl_label) - row.operator("safe_areas.preset_add", text="", icon='ZOOMIN') - row.operator("safe_areas.preset_add", text="", icon='ZOOMOUT').remove_active = True - - layout.separator() - col = layout.column() col.active = show_safe_areas @@ -455,8 +449,8 @@ def draw_display_safe_settings(layout, safe_data, settings): classes = ( - CAMERA_MT_presets, - SAFE_AREAS_MT_presets, + CAMERA_PT_presets, + SAFE_AREAS_PT_presets, DATA_PT_context_camera, DATA_PT_lens, DATA_PT_camera, diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py index 47c53d6ffb5..c0ab9da949f 100644 --- a/release/scripts/startup/bl_ui/properties_data_curve.py +++ b/release/scripts/startup/bl_ui/properties_data_curve.py @@ -135,7 +135,7 @@ class DATA_PT_shape_curve(CurveButtonsPanel, Panel): class DATA_PT_curve_texture_space(CurveButtonsPanel, Panel): bl_label = "Texture Space" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -459,7 +459,7 @@ class DATA_PT_text_boxes(CurveButtonsPanelText, Panel): class DATA_PT_custom_props_curve(CurveButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _context_path = "object.data" _property_type = bpy.types.Curve diff --git a/release/scripts/startup/bl_ui/properties_data_lamp.py b/release/scripts/startup/bl_ui/properties_data_lamp.py index 2727c84e820..d613967584c 100644 --- a/release/scripts/startup/bl_ui/properties_data_lamp.py +++ b/release/scripts/startup/bl_ui/properties_data_lamp.py @@ -22,14 +22,6 @@ from bpy.types import Menu, Panel from rna_prop_ui import PropertyPanel -class LAMP_MT_sunsky_presets(Menu): - bl_label = "Sun & Sky Presets" - preset_subdir = "sunsky" - preset_operator = "script.execute_preset" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} - draw = Menu.draw_preset - - class DataButtonsPanel: bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -44,7 +36,7 @@ class DataButtonsPanel: class DATA_PT_context_lamp(DataButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -63,7 +55,7 @@ class DATA_PT_context_lamp(DataButtonsPanel, Panel): class DATA_PT_preview(DataButtonsPanel, Panel): bl_label = "Preview" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): self.layout.template_preview(context.lamp) @@ -71,7 +63,7 @@ class DATA_PT_preview(DataButtonsPanel, Panel): class DATA_PT_lamp(DataButtonsPanel, Panel): bl_label = "Lamp" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY'} + COMPAT_ENGINES = {'BLENDER_RENDER'} def draw(self, context): layout = self.layout @@ -243,7 +235,7 @@ class DATA_PT_EEVEE_shadow_contact(DataButtonsPanel, Panel): class DATA_PT_area(DataButtonsPanel, Panel): bl_label = "Area Shape" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY'} + COMPAT_ENGINES = {'BLENDER_RENDER'} @classmethod def poll(cls, context): @@ -269,7 +261,7 @@ class DATA_PT_area(DataButtonsPanel, Panel): class DATA_PT_spot(DataButtonsPanel, Panel): bl_label = "Spot Shape" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY'} + COMPAT_ENGINES = {'BLENDER_RENDER'} @classmethod def poll(cls, context): @@ -330,7 +322,7 @@ class DATA_PT_spot(DataButtonsPanel, Panel): class DATA_PT_falloff_curve(DataButtonsPanel, Panel): bl_label = "Falloff Curve" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -346,13 +338,12 @@ class DATA_PT_falloff_curve(DataButtonsPanel, Panel): class DATA_PT_custom_props_lamp(DataButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _context_path = "object.data" _property_type = bpy.types.Lamp classes = ( - LAMP_MT_sunsky_presets, DATA_PT_context_lamp, DATA_PT_preview, DATA_PT_lamp, diff --git a/release/scripts/startup/bl_ui/properties_data_lattice.py b/release/scripts/startup/bl_ui/properties_data_lattice.py index b584e433cb9..40e82bc0a52 100644 --- a/release/scripts/startup/bl_ui/properties_data_lattice.py +++ b/release/scripts/startup/bl_ui/properties_data_lattice.py @@ -85,7 +85,7 @@ class DATA_PT_lattice(DataButtonsPanel, Panel): class DATA_PT_custom_props_lattice(DataButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _context_path = "object.data" _property_type = bpy.types.Lattice diff --git a/release/scripts/startup/bl_ui/properties_data_lightprobe.py b/release/scripts/startup/bl_ui/properties_data_lightprobe.py index 00c6c205530..f3ccc9f3176 100644 --- a/release/scripts/startup/bl_ui/properties_data_lightprobe.py +++ b/release/scripts/startup/bl_ui/properties_data_lightprobe.py @@ -35,7 +35,7 @@ class DataButtonsPanel: class DATA_PT_context_lightprobe(DataButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -52,7 +52,7 @@ class DATA_PT_context_lightprobe(DataButtonsPanel, Panel): class DATA_PT_lightprobe(DataButtonsPanel, Panel): bl_label = "Probe" - COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -114,7 +114,7 @@ class DATA_PT_lightprobe(DataButtonsPanel, Panel): class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel): bl_label = "Custom Parallax" - COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -144,7 +144,7 @@ class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel): class DATA_PT_lightprobe_display(DataButtonsPanel, Panel): bl_label = "Display" - COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_EEVEE'} def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 76ea85d0fb4..5ff9f83b1a9 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -24,7 +24,7 @@ from rna_prop_ui import PropertyPanel class MESH_MT_vertex_group_specials(Menu): bl_label = "Vertex Group Specials" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -48,7 +48,7 @@ class MESH_MT_vertex_group_specials(Menu): class MESH_MT_shape_key_specials(Menu): bl_label = "Shape Key Specials" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -137,7 +137,7 @@ class MeshButtonsPanel: class DATA_PT_context_mesh(MeshButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -154,7 +154,7 @@ class DATA_PT_context_mesh(MeshButtonsPanel, Panel): class DATA_PT_normals(MeshButtonsPanel, Panel): bl_label = "Normals" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -174,7 +174,7 @@ class DATA_PT_normals(MeshButtonsPanel, Panel): class DATA_PT_texture_space(MeshButtonsPanel, Panel): bl_label = "Texture Space" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -194,7 +194,7 @@ class DATA_PT_texture_space(MeshButtonsPanel, Panel): class DATA_PT_vertex_groups(MeshButtonsPanel, Panel): bl_label = "Vertex Groups" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -283,7 +283,7 @@ class DATA_PT_face_maps(MeshButtonsPanel, Panel): class DATA_PT_shape_keys(MeshButtonsPanel, Panel): bl_label = "Shape Keys" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -376,7 +376,7 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel): class DATA_PT_uv_texture(MeshButtonsPanel, Panel): bl_label = "UV Maps" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -395,7 +395,7 @@ class DATA_PT_uv_texture(MeshButtonsPanel, Panel): class DATA_PT_vertex_colors(MeshButtonsPanel, Panel): bl_label = "Vertex Colors" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -415,7 +415,7 @@ class DATA_PT_vertex_colors(MeshButtonsPanel, Panel): class DATA_PT_customdata(MeshButtonsPanel, Panel): bl_label = "Geometry Data" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -441,7 +441,7 @@ class DATA_PT_customdata(MeshButtonsPanel, Panel): class DATA_PT_custom_props_mesh(MeshButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _context_path = "object.data" _property_type = bpy.types.Mesh diff --git a/release/scripts/startup/bl_ui/properties_data_metaball.py b/release/scripts/startup/bl_ui/properties_data_metaball.py index c796c8af141..2a61e6cda79 100644 --- a/release/scripts/startup/bl_ui/properties_data_metaball.py +++ b/release/scripts/startup/bl_ui/properties_data_metaball.py @@ -71,7 +71,7 @@ class DATA_PT_metaball(DataButtonsPanel, Panel): class DATA_PT_mball_texture_space(DataButtonsPanel, Panel): bl_label = "Texture Space" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -125,7 +125,7 @@ class DATA_PT_metaball_element(DataButtonsPanel, Panel): class DATA_PT_custom_props_metaball(DataButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _context_path = "object.data" _property_type = bpy.types.MetaBall diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 428c45697a3..581f3ca91bc 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -1507,6 +1507,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): def NORMAL_EDIT(self, layout, ob, md): has_vgroup = bool(md.vertex_group) + do_polynors_fix = not md.no_polynors_fix needs_object_offset = (((md.mode == 'RADIAL') and not md.target) or ((md.mode == 'DIRECTIONAL') and md.use_direction_parallel)) @@ -1536,7 +1537,9 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): sub = row.row(align=True) sub.active = has_vgroup sub.prop(md, "invert_vertex_group", text="", icon='ARROW_LEFTRIGHT') - subcol.prop(md, "mix_limit") + row = subcol.row(align=True) + row.prop(md, "mix_limit") + row.prop(md, "no_polynors_fix", text="", icon='UNLOCKED' if do_polynors_fix else 'LOCKED') def CORRECTIVE_SMOOTH(self, layout, ob, md): is_bind = md.is_bind diff --git a/release/scripts/startup/bl_ui/properties_data_speaker.py b/release/scripts/startup/bl_ui/properties_data_speaker.py index e43da31b5e8..2a3dc4d02c1 100644 --- a/release/scripts/startup/bl_ui/properties_data_speaker.py +++ b/release/scripts/startup/bl_ui/properties_data_speaker.py @@ -36,7 +36,7 @@ class DataButtonsPanel: class DATA_PT_context_speaker(DataButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -55,7 +55,7 @@ class DATA_PT_context_speaker(DataButtonsPanel, Panel): class DATA_PT_speaker(DataButtonsPanel, Panel): bl_label = "Sound" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -76,7 +76,7 @@ class DATA_PT_speaker(DataButtonsPanel, Panel): class DATA_PT_distance(DataButtonsPanel, Panel): bl_label = "Distance" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -99,7 +99,7 @@ class DATA_PT_distance(DataButtonsPanel, Panel): class DATA_PT_cone(DataButtonsPanel, Panel): bl_label = "Cone" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -121,7 +121,7 @@ class DATA_PT_cone(DataButtonsPanel, Panel): class DATA_PT_custom_props_speaker(DataButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _context_path = "object.data" _property_type = bpy.types.Speaker diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 75cdd2d68c6..2b298c560c7 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -98,7 +98,7 @@ class EEVEE_MATERIAL_PT_context_material(MaterialButtonsPanel, Panel): if ob: is_sortable = len(ob.material_slots) > 1 - rows = 1 + rows = 2 if (is_sortable): rows = 4 diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 34515e2a05a..ea05a639125 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -57,15 +57,17 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel): col = flow.column() row = col.row(align=True) row.prop(ob, "location") - row.prop(ob, "lock_location", text="") + row.use_property_decorate = False + row.prop(ob, "lock_location", text="", emboss=False) if ob.rotation_mode == 'QUATERNION': col = flow.column() row = col.row(align=True) row.prop(ob, "rotation_quaternion", text="Rotation") sub = row.column(align=True) - sub.prop(ob, "lock_rotation_w", text="") - sub.prop(ob, "lock_rotation", text="") + sub.use_property_decorate = False + sub.prop(ob, "lock_rotation_w", text="", emboss=False) + sub.prop(ob, "lock_rotation", text="", emboss=False) elif ob.rotation_mode == 'AXIS_ANGLE': # row.column().label(text="Rotation") #row.column().prop(pchan, "rotation_angle", text="Angle") @@ -75,20 +77,25 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel): row.prop(ob, "rotation_axis_angle", text="Rotation") sub = row.column(align=True) - sub.prop(ob, "lock_rotation_w", text="") - sub.prop(ob, "lock_rotation", text="") + sub.use_property_decorate = False + sub.prop(ob, "lock_rotation_w", text="", emboss=False) + sub.prop(ob, "lock_rotation", text="", emboss=False) else: col = flow.column() row = col.row(align=True) row.prop(ob, "rotation_euler", text="Rotation") - row.prop(ob, "lock_rotation", text="") + row.use_property_decorate = False + row.prop(ob, "lock_rotation", text="", emboss=False) col = flow.column() row = col.row(align=True) row.prop(ob, "scale") - row.prop(ob, "lock_scale", text="") + row.use_property_decorate = False + row.prop(ob, "lock_scale", text="", emboss=False) - layout.prop(ob, "rotation_mode") + row = layout.row(align=True) + row.prop(ob, "rotation_mode") + row.label(text="", icon="BLANK1") class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel): @@ -352,7 +359,7 @@ class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit fr class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _context_path = "object" _property_type = bpy.types.Object diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py index 00eb13dd222..8b4104a6c04 100644 --- a/release/scripts/startup/bl_ui/properties_particle.py +++ b/release/scripts/startup/bl_ui/properties_particle.py @@ -21,6 +21,7 @@ import bpy from bpy.types import Panel, Menu from rna_prop_ui import PropertyPanel from bpy.app.translations import pgettext_iface as iface_ +from bl_operators.presets import PresetMenu from .properties_physics_common import ( point_cache_ui, @@ -66,7 +67,7 @@ def particle_get_settings(context): class PARTICLE_MT_specials(Menu): bl_label = "Particle Specials" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -82,12 +83,12 @@ class PARTICLE_MT_specials(Menu): layout.operator("particle.duplicate_particle_system") -class PARTICLE_MT_hair_dynamics_presets(Menu): +class PARTICLE_PT_hair_dynamics_presets(PresetMenu): bl_label = "Hair Dynamics Presets" preset_subdir = "hair_dynamics" preset_operator = "script.execute_preset" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} - draw = Menu.draw_preset + preset_add_operator = "particle.hair_dynamics_preset_add" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} class ParticleButtonsPanel: @@ -131,7 +132,7 @@ class PARTICLE_UL_particle_systems(bpy.types.UIList): class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -149,7 +150,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): row = layout.row() row.template_list("PARTICLE_UL_particle_systems", "particle_systems", ob, "particle_systems", - ob.particle_systems, "active_index", rows=1) + ob.particle_systems, "active_index", rows=2) col = row.column(align=True) col.operator("object.particle_system_add", icon='ZOOMIN', text="") @@ -234,7 +235,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel): class PARTICLE_PT_emission(ParticleButtonsPanel, Panel): bl_label = "Emission" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -286,7 +287,7 @@ class PARTICLE_PT_emission_source(ParticleButtonsPanel, Panel): bl_label = "Source" bl_parent_id = "PARTICLE_PT_emission" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -324,7 +325,7 @@ class PARTICLE_PT_emission_source(ParticleButtonsPanel, Panel): class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel): bl_label = "Hair Dynamics" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -340,6 +341,16 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel): psys = context.particle_system self.layout.prop(psys, "use_hair_dynamics", text="") + def draw_header_preset(self, context): + psys = context.particle_system + + if not psys.cloth: + return + + layout = self.layout + layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False + PARTICLE_PT_hair_dynamics_presets.draw_panel_header(layout) + def draw(self, context): layout = self.layout @@ -355,11 +366,6 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel): layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False - row = layout.row(align=True) - row.menu("PARTICLE_MT_hair_dynamics_presets", text=bpy.types.PARTICLE_MT_hair_dynamics_presets.bl_label) - row.operator("particle.hair_dynamics_preset_add", text="", icon='ZOOMIN') - row.operator("particle.hair_dynamics_preset_add", text="", icon='ZOOMOUT').remove_active = True - layout.use_property_split = True layout.separator() @@ -400,7 +406,7 @@ class PARTICLE_PT_hair_dynamics_structure(ParticleButtonsPanel, Panel): bl_label = "Structure" bl_parent_id = "PARTICLE_PT_hair_dynamics" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -432,7 +438,7 @@ class PARTICLE_PT_hair_dynamics_volume(ParticleButtonsPanel, Panel): bl_label = "Volume" bl_parent_id = "PARTICLE_PT_hair_dynamics" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -464,7 +470,7 @@ class PARTICLE_PT_hair_dynamics_volume(ParticleButtonsPanel, Panel): class PARTICLE_PT_cache(ParticleButtonsPanel, Panel): bl_label = "Cache" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -494,7 +500,7 @@ class PARTICLE_PT_cache(ParticleButtonsPanel, Panel): class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel): bl_label = "Velocity" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -543,7 +549,7 @@ class PARTICLE_PT_velocity(ParticleButtonsPanel, Panel): class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel): bl_label = "Rotation" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -596,7 +602,7 @@ class PARTICLE_PT_rotation_angular_velocity(ParticleButtonsPanel, Panel): bl_label = "Angular Velocity" bl_parent_id = "PARTICLE_PT_rotation" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -620,7 +626,7 @@ class PARTICLE_PT_rotation_angular_velocity(ParticleButtonsPanel, Panel): class PARTICLE_PT_physics(ParticleButtonsPanel, Panel): bl_label = "Physics" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -818,7 +824,7 @@ class PARTICLE_PT_physics_deflection(ParticleButtonsPanel, Panel): bl_label = "Deflection" bl_parent_id = "PARTICLE_PT_physics" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -844,7 +850,7 @@ class PARTICLE_PT_physics_deflection(ParticleButtonsPanel, Panel): class PARTICLE_PT_physics_forces(ParticleButtonsPanel, Panel): bl_label = "Forces" bl_parent_id = "PARTICLE_PT_physics" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -871,7 +877,7 @@ class PARTICLE_PT_physics_integration(ParticleButtonsPanel, Panel): bl_label = "Integration" bl_options = {'DEFAULT_CLOSED'} bl_parent_id = "PARTICLE_PT_physics" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -903,7 +909,7 @@ class PARTICLE_PT_physics_integration(ParticleButtonsPanel, Panel): class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel): bl_label = "Boid Brain" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1006,7 +1012,7 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel, Panel): class PARTICLE_PT_render(ParticleButtonsPanel, Panel): bl_label = "Render" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1046,7 +1052,7 @@ class PARTICLE_PT_render_extra(ParticleButtonsPanel, Panel): bl_label = "Extra" bl_parent_id = "PARTICLE_PT_render" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1073,7 +1079,7 @@ class PARTICLE_PT_render_line(ParticleButtonsPanel, Panel): bl_label = "Line" bl_parent_id = "PARTICLE_PT_render" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1101,7 +1107,7 @@ class PARTICLE_PT_render_path(ParticleButtonsPanel, Panel): bl_label = "Path" bl_parent_id = "PARTICLE_PT_render" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1136,7 +1142,7 @@ class PARTICLE_PT_render_path_timing(ParticleButtonsPanel, Panel): bl_label = "Timing" bl_parent_id = "PARTICLE_PT_render" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1168,7 +1174,7 @@ class PARTICLE_PT_render_object(ParticleButtonsPanel, Panel): bl_label = "Object" bl_parent_id = "PARTICLE_PT_render" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1196,7 +1202,7 @@ class PARTICLE_PT_render_collection(ParticleButtonsPanel, Panel): bl_label = "Collection" bl_parent_id = "PARTICLE_PT_render" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1228,7 +1234,7 @@ class PARTICLE_PT_render_collection_use_count(ParticleButtonsPanel, Panel): bl_label = "Use Count" bl_parent_id = "PARTICLE_PT_render_collection" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1277,7 +1283,7 @@ class PARTICLE_PT_render_billboards_alignment(ParticleButtonsPanel, Panel): bl_label = "Billboard Alignment" bl_parent_id = "PARTICLE_PT_render" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1303,7 +1309,7 @@ class PARTICLE_PT_render_billboards_tilt(ParticleButtonsPanel, Panel): bl_label = "Billboard Tilt" bl_parent_id = "PARTICLE_PT_render" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1337,7 +1343,7 @@ class PARTICLE_PT_render_billboards_uv(ParticleButtonsPanel, Panel): bl_label = "Billboard UVs" bl_parent_id = "PARTICLE_PT_render" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1373,7 +1379,7 @@ class PARTICLE_PT_render_trails(ParticleButtonsPanel, Panel): bl_label = "Trails" bl_parent_id = "PARTICLE_PT_render" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1401,7 +1407,7 @@ class PARTICLE_PT_render_trails(ParticleButtonsPanel, Panel): class PARTICLE_PT_draw(ParticleButtonsPanel, Panel): bl_label = "Viewport Display" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1463,7 +1469,7 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, Panel): class PARTICLE_PT_children(ParticleButtonsPanel, Panel): bl_label = "Children" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1519,7 +1525,7 @@ class PARTICLE_PT_children_parting(ParticleButtonsPanel, Panel): bl_label = "Parting" bl_parent_id = "PARTICLE_PT_children" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1544,7 +1550,7 @@ class PARTICLE_PT_children_clumping(ParticleButtonsPanel, Panel): bl_label = "Clumping" bl_parent_id = "PARTICLE_PT_children" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1586,7 +1592,7 @@ class PARTICLE_PT_children_roughness(ParticleButtonsPanel, Panel): bl_label = "Roughness" bl_parent_id = "PARTICLE_PT_children" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1628,7 +1634,7 @@ class PARTICLE_PT_children_kink(ParticleButtonsPanel, Panel): bl_label = "Kink" bl_parent_id = "PARTICLE_PT_children" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1679,7 +1685,7 @@ class PARTICLE_PT_children_kink(ParticleButtonsPanel, Panel): class PARTICLE_PT_field_weights(ParticleButtonsPanel, Panel): bl_label = "Field Weights" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1700,7 +1706,7 @@ class PARTICLE_PT_field_weights(ParticleButtonsPanel, Panel): class PARTICLE_PT_force_fields(ParticleButtonsPanel, Panel): bl_label = "Force Field Settings" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -1734,7 +1740,7 @@ class PARTICLE_PT_force_fields(ParticleButtonsPanel, Panel): class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, Panel): bl_label = "Vertex Groups" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1807,7 +1813,7 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, Panel): class PARTICLE_PT_textures(ParticleButtonsPanel, Panel): bl_label = "Textures" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1839,7 +1845,7 @@ class PARTICLE_PT_textures(ParticleButtonsPanel, Panel): class PARTICLE_PT_hair_shape(ParticleButtonsPanel, Panel): bl_label = "Hair Shape" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -1866,14 +1872,14 @@ class PARTICLE_PT_hair_shape(ParticleButtonsPanel, Panel): class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _context_path = "particle_system.settings" _property_type = bpy.types.ParticleSettings classes = ( PARTICLE_MT_specials, - PARTICLE_MT_hair_dynamics_presets, + PARTICLE_PT_hair_dynamics_presets, PARTICLE_UL_particle_systems, PARTICLE_PT_context_particles, PARTICLE_PT_emission, diff --git a/release/scripts/startup/bl_ui/properties_physics_cloth.py b/release/scripts/startup/bl_ui/properties_physics_cloth.py index f450bc61635..2f659af3891 100644 --- a/release/scripts/startup/bl_ui/properties_physics_cloth.py +++ b/release/scripts/startup/bl_ui/properties_physics_cloth.py @@ -19,6 +19,7 @@ # <pep8 compliant> import bpy from bpy.types import Menu, Panel +from bl_operators.presets import PresetMenu from .properties_physics_common import ( point_cache_ui, @@ -30,11 +31,11 @@ def cloth_panel_enabled(md): return md.point_cache.is_baked is False -class CLOTH_MT_presets(Menu): +class CLOTH_PT_presets(PresetMenu): bl_label = "Cloth Presets" preset_subdir = "cloth" preset_operator = "script.execute_preset" - draw = Menu.draw_preset + preset_add_operator = "cloth.preset_add" class PhysicButtonsPanel: @@ -52,6 +53,9 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): bl_label = "Cloth" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + def draw_header_preset(self, context): + CLOTH_PT_presets.draw_panel_header(self.layout) + def draw(self, context): layout = self.layout @@ -63,16 +67,6 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): split = layout.split(percentage=0.25) - col = split.column() - - split.label(text="Presets:") - sub = split.row(align=True) - sub.menu("CLOTH_MT_presets", text=bpy.types.CLOTH_MT_presets.bl_label) - sub.operator("cloth.preset_add", text="", icon='ZOOMIN') - sub.operator("cloth.preset_add", text="", icon='ZOOMOUT').remove_active = True - - split = layout.split(percentage=0.25) - split.label(text="Quality:") split.prop(cloth, "quality", text="Steps") @@ -132,7 +126,8 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel): class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel): - bl_label = "Cloth Cache" + bl_label = "Cache" + bl_parent_id = 'PHYSICS_PT_cloth' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -142,7 +137,8 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel, Panel): class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel): - bl_label = "Cloth Collision" + bl_label = "Collision" + bl_parent_id = 'PHYSICS_PT_cloth' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -182,7 +178,8 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel, Panel): class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel): - bl_label = "Cloth Stiffness Scaling" + bl_label = "Stiffness Scaling" + bl_parent_id = 'PHYSICS_PT_cloth' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -215,7 +212,8 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel, Panel): class PHYSICS_PT_cloth_sewing(PhysicButtonsPanel, Panel): - bl_label = "Cloth Sewing Springs" + bl_label = "Sewing Springs" + bl_parent_id = 'PHYSICS_PT_cloth' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -249,7 +247,8 @@ class PHYSICS_PT_cloth_sewing(PhysicButtonsPanel, Panel): class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel): - bl_label = "Cloth Field Weights" + bl_label = "Field Weights" + bl_parent_id = 'PHYSICS_PT_cloth' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -259,7 +258,7 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel): classes = ( - CLOTH_MT_presets, + CLOTH_PT_presets, PHYSICS_PT_cloth, PHYSICS_PT_cloth_cache, PHYSICS_PT_cloth_collision, diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py index 05c72bf47ee..b26fbb9e906 100644 --- a/release/scripts/startup/bl_ui/properties_physics_common.py +++ b/release/scripts/startup/bl_ui/properties_physics_common.py @@ -240,12 +240,10 @@ def effector_weights_ui(self, context, weights, weight_type): def basic_force_field_settings_ui(self, context, field): layout = self.layout - split = layout.split() - if not field or field.type == 'NONE': return - col = split.column() + col = layout.column() if field.type == 'DRAG': col.prop(field, "linear_drag", text="Linear") @@ -265,10 +263,10 @@ def basic_force_field_settings_ui(self, context, field): else: col.prop(field, "flow") - col = split.column() + col = layout.column() sub = col.column(align=True) sub.prop(field, "noise") - sub.prop(field, "seed") + sub.prop(field, "seed", text="Noise Seed") if field.type == 'TURBULENCE': col.prop(field, "use_global_coords", text="Global") elif field.type == 'HARMONIC': @@ -276,46 +274,34 @@ def basic_force_field_settings_ui(self, context, field): if field.type == 'FORCE': col.prop(field, "use_gravity_falloff", text="Gravitation") - split = layout.split() - - col = split.column() - col.label(text="Effect point:") + col.label(text="Effect point") col.prop(field, "apply_to_location") col.prop(field, "apply_to_rotation") - col = split.column() - col.label(text="Collision:") + col.label(text="Collision") col.prop(field, "use_absorption") def basic_force_field_falloff_ui(self, context, field): layout = self.layout - split = layout.split(percentage=0.35) - if not field or field.type == 'NONE': return - col = split.column() - col.prop(field, "z_direction", text="") + col = layout.column() + col.prop(field, "z_direction") - col = split.column() col.prop(field, "falloff_power", text="Power") - split = layout.split() - col = split.column() - row = col.row(align=True) - row.prop(field, "use_min_distance", text="") - sub = row.row(align=True) + col.prop(field, "use_min_distance", text="Min Min Distance") + sub = col.column(align=True) sub.active = field.use_min_distance - sub.prop(field, "distance_min", text="Minimum") + sub.prop(field, "distance_min", text="Min Distance") - col = split.column() - row = col.row(align=True) - row.prop(field, "use_max_distance", text="") - sub = row.row(align=True) + col.prop(field, "use_max_distance", text="Use Max Distance") + sub = col.column(align=True) sub.active = field.use_max_distance - sub.prop(field, "distance_max", text="Maximum") + sub.prop(field, "distance_max", text="Max Distance") classes = ( diff --git a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py index 476a448f978..6a66dafadf0 100644 --- a/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py +++ b/release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py @@ -127,7 +127,8 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel): class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel): - bl_label = "Dynamic Paint Advanced" + bl_label = "Advanced" + bl_parent_id = "PHYSICS_PT_dynamic_paint" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod @@ -202,7 +203,8 @@ class PHYSICS_PT_dp_advanced_canvas(PhysicButtonsPanel, Panel): class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel): - bl_label = "Dynamic Paint Output" + bl_label = "Output" + bl_parent_id = "PHYSICS_PT_dynamic_paint" bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -295,7 +297,8 @@ class PHYSICS_PT_dp_canvas_output(PhysicButtonsPanel, Panel): class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel): - bl_label = "Dynamic Paint Initial Color" + bl_label = "Initial Color" + bl_parent_id = "PHYSICS_PT_dynamic_paint" bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -331,7 +334,8 @@ class PHYSICS_PT_dp_canvas_initial_color(PhysicButtonsPanel, Panel): class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel): - bl_label = "Dynamic Paint Effects" + bl_label = "Effects" + bl_parent_id = "PHYSICS_PT_dynamic_paint" bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -380,7 +384,8 @@ class PHYSICS_PT_dp_effects(PhysicButtonsPanel, Panel): class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel): - bl_label = "Dynamic Paint Cache" + bl_label = "Cache" + bl_parent_id = "PHYSICS_PT_dynamic_paint" bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -402,7 +407,8 @@ class PHYSICS_PT_dp_cache(PhysicButtonsPanel, Panel): class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel): - bl_label = "Dynamic Paint Source" + bl_label = "Source" + bl_parent_id = "PHYSICS_PT_dynamic_paint" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod @@ -454,7 +460,8 @@ class PHYSICS_PT_dp_brush_source(PhysicButtonsPanel, Panel): class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel): - bl_label = "Dynamic Paint Velocity" + bl_label = "Velocity" + bl_parent_id = "PHYSICS_PT_dynamic_paint" bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -490,7 +497,8 @@ class PHYSICS_PT_dp_brush_velocity(PhysicButtonsPanel, Panel): class PHYSICS_PT_dp_brush_wave(PhysicButtonsPanel, Panel): - bl_label = "Dynamic Paint Waves" + bl_label = "Waves" + bl_parent_id = "PHYSICS_PT_dynamic_paint" bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} diff --git a/release/scripts/startup/bl_ui/properties_physics_field.py b/release/scripts/startup/bl_ui/properties_physics_field.py index 3e3a2145682..72b5d9f1574 100644 --- a/release/scripts/startup/bl_ui/properties_physics_field.py +++ b/release/scripts/startup/bl_ui/properties_physics_field.py @@ -38,7 +38,7 @@ class PhysicButtonsPanel: class PHYSICS_PT_field(PhysicButtonsPanel, Panel): bl_label = "Force Fields" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -47,44 +47,34 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True ob = context.object field = ob.field - split = layout.split(percentage=0.2) - split.label(text="Type:") - - split.prop(field, "type", text="") + layout.prop(field, "type") if field.type not in {'NONE', 'GUIDE', 'TEXTURE'}: - split = layout.split(percentage=0.2) - split.label(text="Shape:") - split.prop(field, "shape", text="") + layout.prop(field, "shape", text="Shape") elif field.type == 'TEXTURE': - split = layout.split(percentage=0.2) - split.label(text="Texture:") - split.row().template_ID(field, "texture", new="texture.new") - - split = layout.split() + layout.row().template_ID(field, "texture", new="texture.new") if field.type == 'NONE': return # nothing to draw elif field.type == 'GUIDE': - col = split.column() + col = layout.column() col.prop(field, "guide_minimum") col.prop(field, "guide_free") col.prop(field, "falloff_power") col.prop(field, "use_guide_path_add") col.prop(field, "use_guide_path_weight") - col = split.column() - col.label(text="Clumping:") + col.label(text="Clumping") col.prop(field, "guide_clump_amount") col.prop(field, "guide_clump_shape") - row = layout.row() - row.prop(field, "use_max_distance") - sub = row.row() + col.prop(field, "use_max_distance") + sub = col.column() sub.active = field.use_max_distance sub.prop(field, "distance_max") @@ -94,88 +84,91 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel): if field.guide_kink_type != 'NONE': layout.prop(field, "guide_kink_axis") - split = layout.split() - - col = split.column() + col = layout.column() col.prop(field, "guide_kink_frequency") col.prop(field, "guide_kink_shape") - - col = split.column() col.prop(field, "guide_kink_amplitude") elif field.type == 'TEXTURE': - col = split.column() + col = layout.column() col.prop(field, "strength") - col.prop(field, "texture_mode", text="") + col.prop(field, "texture_mode") col.prop(field, "texture_nabla") - col = split.column() col.prop(field, "use_object_coords") col.prop(field, "use_2d_force") elif field.type == 'SMOKE_FLOW': - col = split.column() + col = layout.column() col.prop(field, "strength") col.prop(field, "flow") - col = split.column() - col.label(text="Domain Object:") - col.prop(field, "source_object", "") + col.prop(field, "source_object") col.prop(field, "use_smoke_density") else: basic_force_field_settings_ui(self, context, field) - if field.type not in {'NONE', 'GUIDE'}: - layout.label(text="Falloff:") - layout.row().prop(field, "falloff_type", expand=True) +class PHYSICS_PT_field_falloff(PhysicButtonsPanel, Panel): + bl_label = "Falloff" + bl_parent_id = "PHYSICS_PT_field" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} - basic_force_field_falloff_ui(self, context, field) + @classmethod + def poll(cls, context): + ob = context.object + return (context.engine in cls.COMPAT_ENGINES) and (ob.field) and (ob.field.type not in {'NONE', 'GUIDE'}) - if field.falloff_type == 'CONE': - layout.separator() + def draw(self, context): + layout = self.layout + layout.use_property_split = True - split = layout.split(percentage=0.35) + ob = context.object + field = ob.field - col = split.column() - col.label(text="Angular:") - col.prop(field, "use_radial_min", text="Use Minimum") - col.prop(field, "use_radial_max", text="Use Maximum") + layout.prop(field, "falloff_type", text="Shape") - col = split.column() - col.prop(field, "radial_falloff", text="Power") + basic_force_field_falloff_ui(self, context, field) - sub = col.column() - sub.active = field.use_radial_min - sub.prop(field, "radial_min", text="Angle") + if field.falloff_type == 'CONE': + layout.separator() + + col = layout.column() + col.prop(field, "radial_falloff", text="Power") - sub = col.column() - sub.active = field.use_radial_max - sub.prop(field, "radial_max", text="Angle") + col.label(text="Angular") - elif field.falloff_type == 'TUBE': - layout.separator() + col.prop(field, "use_radial_min", text="Use Min Angle") + sub = col.column() + sub.active = field.use_radial_min + sub.prop(field, "radial_min", text="Min Angle") - split = layout.split(percentage=0.35) + col.prop(field, "use_radial_max", text="Use Max Angle") + sub = col.column() + sub.active = field.use_radial_max + sub.prop(field, "radial_max", text="Max Angle") - col = split.column() - col.label(text="Radial:") - col.prop(field, "use_radial_min", text="Use Minimum") - col.prop(field, "use_radial_max", text="Use Maximum") + elif field.falloff_type == 'TUBE': + layout.separator() - col = split.column() - col.prop(field, "radial_falloff", text="Power") + col = layout.column() - sub = col.column() - sub.active = field.use_radial_min - sub.prop(field, "radial_min", text="Distance") + col.prop(field, "radial_falloff", text="Power") - sub = col.column() - sub.active = field.use_radial_max - sub.prop(field, "radial_max", text="Distance") + col.label(text="Radial") + + col.prop(field, "use_radial_min", text="Use Minimum") + sub = col.column() + sub.active = field.use_radial_min + sub.prop(field, "radial_min", text="Distance") + + col.prop(field, "use_radial_max", text="Use Maximum") + sub = col.column() + sub.active = field.use_radial_max + sub.prop(field, "radial_max", text="Distance") class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): bl_label = "Collision" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -188,6 +181,7 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): md = context.collision split = layout.split() + layout.use_property_split = True coll = md.settings @@ -196,39 +190,90 @@ class PHYSICS_PT_collision(PhysicButtonsPanel, Panel): layout.active = settings.use - split = layout.split() + col = layout.column() + col.prop(settings, "absorption", text="Force Field Absorption") + + +class PHYSICS_PT_collision_particle(PhysicButtonsPanel, Panel): + bl_label = "Particle" + bl_parent_id = "PHYSICS_PT_collision" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + + @classmethod + def poll(cls, context): + ob = context.object + return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.collision) + + def draw(self, context): + layout = self.layout + + md = context.collision - col = split.column() - col.label(text="Particle:") + layout.use_property_split = True + flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False) + + coll = md.settings + + if coll: + settings = context.object.collision + + layout.active = settings.use + + col = flow.column() col.prop(settings, "permeability", slider=True) col.prop(settings, "stickiness") + col = flow.column() col.prop(settings, "use_particle_kill") - col.label(text="Particle Damping:") - sub = col.column(align=True) - sub.prop(settings, "damping_factor", text="Factor", slider=True) - sub.prop(settings, "damping_random", text="Random", slider=True) - col.label(text="Particle Friction:") + col = flow.column() sub = col.column(align=True) - sub.prop(settings, "friction_factor", text="Factor", slider=True) - sub.prop(settings, "friction_random", text="Random", slider=True) + sub.prop(settings, "damping_factor", text="Damping", slider=True) + sub.prop(settings, "damping_random", text="Randomize", slider=True) - col = split.column() - col.label(text="Soft Body and Cloth:") + col = flow.column() sub = col.column(align=True) - sub.prop(settings, "thickness_outer", text="Outer", slider=True) - sub.prop(settings, "thickness_inner", text="Inner", slider=True) + sub.prop(settings, "friction_factor", text="Friction", slider=True) + sub.prop(settings, "friction_random", text="Randomize", slider=True) + + +class PHYSICS_PT_collision_softbody(PhysicButtonsPanel, Panel): + bl_label = "Softbody" + bl_parent_id = "PHYSICS_PT_collision" + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + + @classmethod + def poll(cls, context): + ob = context.object + return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.collision) + + def draw(self, context): + layout = self.layout + + layout.use_property_split = True + flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False) + + md = context.collision + coll = md.settings + + if coll: + settings = context.object.collision + + layout.active = settings.use - col.label(text="Soft Body Damping:") - col.prop(settings, "damping", text="Factor", slider=True) + col = flow.column() + col.prop(settings, "damping", text="Damping", slider=True) - col.label(text="Force Fields:") - col.prop(settings, "absorption", text="Absorption") + col = flow.column() + col.prop(settings, "thickness_outer", text="Thickness Outer", slider=True) + col.prop(settings, "thickness_inner", text="Inner", slider=True) classes = ( PHYSICS_PT_field, + PHYSICS_PT_field_falloff, PHYSICS_PT_collision, + PHYSICS_PT_collision_particle, + PHYSICS_PT_collision_softbody, ) if __name__ == "__main__": # only for live edit. diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index 93f1d28e536..94611808059 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -20,13 +20,14 @@ import bpy from bpy.types import Panel, Menu from bpy.app.translations import pgettext_iface as iface_ +from bl_operators.presets import PresetMenu -class FLUID_MT_presets(Menu): +class FLUID_PT_presets(PresetMenu): bl_label = "Fluid Presets" preset_subdir = "fluid" preset_operator = "script.execute_preset" - draw = Menu.draw_preset + preset_add_operator = "fluid.preset_add" class PhysicButtonsPanel: @@ -203,7 +204,8 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel): class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): - bl_label = "Fluid World" + bl_label = "World" + bl_parent_id = 'PHYSICS_PT_fluid' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -240,11 +242,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): col.prop(fluid, "simulation_scale", text="Meters") col = split.column() - col.label(text="Viscosity Presets:") - sub = col.row(align=True) - sub.menu("FLUID_MT_presets", text=bpy.types.FLUID_MT_presets.bl_label) - sub.operator("fluid.preset_add", text="", icon='ZOOMIN') - sub.operator("fluid.preset_add", text="", icon='ZOOMOUT').remove_active = True + FLUID_PT_presets.draw_menu(col, text="Viscosity Presets") sub = col.column(align=True) sub.prop(fluid, "viscosity_base", text="Base") @@ -256,7 +254,8 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel): class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel): - bl_label = "Fluid Boundary" + bl_label = "Boundary" + bl_parent_id = 'PHYSICS_PT_fluid' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -286,7 +285,8 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel, Panel): class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel): - bl_label = "Fluid Particles" + bl_label = "Particles" + bl_parent_id = 'PHYSICS_PT_fluid' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -306,7 +306,7 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel): classes = ( - FLUID_MT_presets, + FLUID_PT_presets, PHYSICS_PT_fluid, PHYSICS_PT_domain_gravity, PHYSICS_PT_domain_boundary, diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py index 3cb9026fd02..de8bca229e4 100644 --- a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py +++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py @@ -55,7 +55,8 @@ class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel): class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel): - bl_label = "Rigid Body Collisions" + bl_label = "Collisions" + bl_parent_id = 'PHYSICS_PT_rigid_body' COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod @@ -99,7 +100,8 @@ class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel): class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel): - bl_label = "Rigid Body Dynamics" + bl_label = "Dynamics" + bl_parent_id = 'PHYSICS_PT_rigid_body' bl_default_closed = True COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index ddb898c7881..acbaecbda4c 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -135,7 +135,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel): - bl_label = "Smoke Flow Advanced" + bl_label = "Advanced" + bl_parent_id = 'PHYSICS_PT_smoke' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -170,7 +171,8 @@ class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel): class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel): - bl_label = "Smoke Flames" + bl_label = "Flames" + bl_parent_id = 'PHYSICS_PT_smoke' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -200,7 +202,8 @@ class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel): class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel): - bl_label = "Smoke Adaptive Domain" + bl_label = "Adaptive Domain" + bl_parent_id = 'PHYSICS_PT_smoke' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -234,7 +237,8 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel): class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): - bl_label = "Smoke High Resolution" + bl_label = "High Resolution" + bl_parent_id = 'PHYSICS_PT_smoke' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -273,7 +277,8 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel): - bl_label = "Smoke Groups" + bl_label = "Groups" + bl_parent_id = 'PHYSICS_PT_smoke' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -301,7 +306,8 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel): class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel): - bl_label = "Smoke Cache" + bl_label = "Cache" + bl_parent_id = 'PHYSICS_PT_smoke' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -337,7 +343,8 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel): class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel): - bl_label = "Smoke Field Weights" + bl_label = "Field Weights" + bl_parent_id = 'PHYSICS_PT_smoke' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -351,8 +358,9 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel): effector_weights_ui(self, context, domain.effector_weights, 'SMOKE') -class PHYSICS_PT_smoke_display_settings(PhysicButtonsPanel, Panel): - bl_label = "Smoke Display Settings" +class PHYSICS_PT_smoke_viewport_display(PhysicButtonsPanel, Panel): + bl_label = "Viewport Display" + bl_parent_id = 'PHYSICS_PT_smoke' bl_options = {'DEFAULT_CLOSED'} @classmethod @@ -389,23 +397,53 @@ class PHYSICS_PT_smoke_display_settings(PhysicButtonsPanel, Panel): row.enabled = do_full_slicing or not do_axis_slicing row.prop(domain, "slice_per_voxel") - layout.separator() - layout.label(text="Debug:") - layout.prop(domain, "draw_velocity") - col = layout.column() - col.enabled = domain.draw_velocity - col.prop(domain, "vector_draw_type") - col.prop(domain, "vector_scale") - layout.separator() - layout.label(text="Color Mapping:") - layout.prop(domain, "use_color_ramp") +class PHYSICS_PT_smoke_viewport_display_color(PhysicButtonsPanel, Panel): + bl_label = "Color Mapping" + bl_parent_id = 'PHYSICS_PT_smoke_viewport_display' + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.smoke + return md and (md.smoke_type == 'DOMAIN') + + def draw_header(self, context): + md = context.smoke.domain_settings + + self.layout.prop(md, "use_color_ramp", text="") + + def draw(self, context): + domain = context.smoke.domain_settings + layout = self.layout + col = layout.column() col.enabled = domain.use_color_ramp col.prop(domain, "coba_field") col.template_color_ramp(domain, "color_ramp", expand=True) +class PHYSICS_PT_smoke_viewport_display_debug(PhysicButtonsPanel, Panel): + bl_label = "Debug" + bl_parent_id = 'PHYSICS_PT_smoke_viewport_display' + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + md = context.smoke + return md and (md.smoke_type == 'DOMAIN') + + def draw(self, context): + domain = context.smoke.domain_settings + layout = self.layout + + layout.prop(domain, "draw_velocity") + col = layout.column() + col.enabled = domain.draw_velocity + col.prop(domain, "vector_draw_type") + col.prop(domain, "vector_scale") + + classes = ( PHYSICS_PT_smoke, PHYSICS_PT_smoke_flow_advanced, @@ -415,7 +453,9 @@ classes = ( PHYSICS_PT_smoke_groups, PHYSICS_PT_smoke_cache, PHYSICS_PT_smoke_field_weights, - PHYSICS_PT_smoke_display_settings, + PHYSICS_PT_smoke_viewport_display, + PHYSICS_PT_smoke_viewport_display_color, + PHYSICS_PT_smoke_viewport_display_debug, ) if __name__ == "__main__": # only for live edit. diff --git a/release/scripts/startup/bl_ui/properties_physics_softbody.py b/release/scripts/startup/bl_ui/properties_physics_softbody.py index 86b9a95e294..68db165875e 100644 --- a/release/scripts/startup/bl_ui/properties_physics_softbody.py +++ b/release/scripts/startup/bl_ui/properties_physics_softbody.py @@ -74,7 +74,8 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel, Panel): class PHYSICS_PT_softbody_cache(PhysicButtonsPanel, Panel): - bl_label = "Soft Body Cache" + bl_label = "Cache" + bl_parent_id = 'PHYSICS_PT_softbody' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -84,7 +85,8 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel, Panel): class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel): - bl_label = "Soft Body Goal" + bl_label = "Goal" + bl_parent_id = 'PHYSICS_PT_softbody' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -124,7 +126,8 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel, Panel): class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel): - bl_label = "Soft Body Edges" + bl_label = "Edges" + bl_parent_id = 'PHYSICS_PT_softbody' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -174,7 +177,8 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel, Panel): class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel): - bl_label = "Soft Body Self Collision" + bl_label = "Self Collision" + bl_parent_id = 'PHYSICS_PT_softbody' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -203,7 +207,8 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel, Panel): class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel): - bl_label = "Soft Body Solver" + bl_label = "Solver" + bl_parent_id = 'PHYSICS_PT_softbody' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @@ -236,7 +241,8 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel, Panel): class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel, Panel): - bl_label = "Soft Body Field Weights" + bl_label = "Field Weights" + bl_parent_id = 'PHYSICS_PT_softbody' bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 7cb0ce55be3..40cd0e20769 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -20,20 +20,20 @@ # <pep8 compliant> import bpy from bpy.types import Menu, Panel, UIList +from bl_operators.presets import PresetMenu -class RENDER_MT_presets(Menu): +class RENDER_PT_presets(PresetMenu): bl_label = "Render Presets" preset_subdir = "render" preset_operator = "script.execute_preset" - draw = Menu.draw_preset + preset_add_operator = "render.preset_add" -class RENDER_MT_ffmpeg_presets(Menu): +class RENDER_PT_ffmpeg_presets(PresetMenu): bl_label = "FFMPEG Presets" preset_subdir = "ffmpeg" preset_operator = "script.python_file_run" - draw = Menu.draw_preset class RENDER_MT_framerate_presets(Menu): @@ -68,6 +68,7 @@ class RENDER_PT_context(Panel): def draw(self, context): layout = self.layout layout.use_property_split = True + layout.use_property_decorate = False scene = context.scene rd = scene.render @@ -83,6 +84,9 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel): _frame_rate_args_prev = None _preset_class = None + def draw_header_preset(self, context): + RENDER_PT_presets.draw_panel_header(self.layout) + @staticmethod def _draw_framerate_label(*args): # avoids re-creating text string each draw @@ -127,15 +131,11 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel): def draw(self, context): layout = self.layout layout.use_property_split = True + layout.use_property_decorate = False # No animation. scene = context.scene rd = scene.render - row = layout.row(align=True) - row.menu("RENDER_MT_presets", text=bpy.types.RENDER_MT_presets.bl_label) - row.operator("render.preset_add", text="", icon='ZOOMIN') - row.operator("render.preset_add", text="", icon='ZOOMOUT').remove_active = True - col = layout.column(align=True) col.prop(rd, "resolution_x", text="Resolution X") col.prop(rd, "resolution_y", text="Y") @@ -171,6 +171,7 @@ class RENDER_PT_frame_remapping(RenderButtonsPanel, Panel): def draw(self, context): layout = self.layout layout.use_property_split = True + layout.use_property_decorate = False # No animation. rd = context.scene.render @@ -269,6 +270,7 @@ class RENDER_PT_output(RenderButtonsPanel, Panel): def draw(self, context): layout = self.layout layout.use_property_split = False + layout.use_property_decorate = False # No animation. rd = context.scene.render image_settings = rd.image_settings @@ -297,6 +299,9 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel): bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + def draw_header_preset(self, context): + RENDER_PT_ffmpeg_presets.draw_panel_header(self.layout) + @classmethod def poll(cls, context): rd = context.scene.render @@ -308,8 +313,6 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel): rd = context.scene.render ffmpeg = rd.ffmpeg - layout.menu("RENDER_MT_ffmpeg_presets", text="Presets") - split = layout.split() split.prop(rd.ffmpeg, "format") split.prop(ffmpeg, "use_autosplit") @@ -378,7 +381,7 @@ class RENDER_UL_renderviews(UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): view = item if self.layout_type in {'DEFAULT', 'COMPACT'}: - if view.name in {'left', 'right'}: + if view.name in {"left", "right"}: layout.label(view.name, icon_value=icon + (not view.use)) else: layout.prop(view, "name", text="", index=index, icon_value=icon, emboss=False) @@ -391,7 +394,7 @@ class RENDER_UL_renderviews(UIList): class RENDER_PT_stereoscopy(RenderButtonsPanel, Panel): bl_label = "Stereoscopy" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} bl_options = {'DEFAULT_CLOSED'} def draw_header(self, context): @@ -432,28 +435,6 @@ class RENDER_PT_stereoscopy(RenderButtonsPanel, Panel): row.prop(rv, "camera_suffix", text="") -class RENDER_PT_clay_settings(RenderButtonsPanel, Panel): - bl_label = "Clay Settings" - COMPAT_ENGINES = {'BLENDER_CLAY'} - - def draw(self, context): - layout = self.layout - props = context.scene.display - - col = layout.column() - col.template_icon_view(props, "matcap_icon") - col.prop(props, "matcap_rotation") - col.prop(props, "matcap_hue") - col.prop(props, "matcap_saturation") - col.prop(props, "matcap_value") - col.prop(props, "matcap_ssao_samples") - col.prop(props, "matcap_ssao_factor_cavity") - col.prop(props, "matcap_ssao_factor_edge") - col.prop(props, "matcap_ssao_distance") - col.prop(props, "matcap_ssao_attenuation") - col.prop(props, "matcap_hair_brightness_randomness") - - class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel): bl_label = "Ambient Occlusion" bl_options = {'DEFAULT_CLOSED'} @@ -707,6 +688,7 @@ class RENDER_PT_eevee_sampling(RenderButtonsPanel, Panel): def draw(self, context): layout = self.layout layout.use_property_split = True + layout.use_property_decorate = False # No animation. scene = context.scene props = scene.eevee @@ -782,8 +764,8 @@ class RENDER_PT_hair(RenderButtonsPanel, Panel): classes = ( - RENDER_MT_presets, - RENDER_MT_ffmpeg_presets, + RENDER_PT_presets, + RENDER_PT_ffmpeg_presets, RENDER_MT_framerate_presets, RENDER_PT_context, RENDER_PT_dimensions, @@ -796,7 +778,6 @@ classes = ( RENDER_UL_renderviews, RENDER_PT_stereoscopy, RENDER_PT_hair, - RENDER_PT_clay_settings, RENDER_PT_eevee_sampling, RENDER_PT_eevee_film, RENDER_PT_eevee_shadows, diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index 4c5b1a86235..a4991ef5718 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -25,6 +25,7 @@ from bpy.types import ( ) from rna_prop_ui import PropertyPanel +from bl_operators.presets import PresetMenu from .properties_physics_common import ( point_cache_ui, @@ -32,12 +33,12 @@ from .properties_physics_common import ( ) -class SCENE_MT_units_length_presets(Menu): +class SCENE_PT_units_length_presets(PresetMenu): """Unit of measure for properties that use length values""" bl_label = "Unit Presets" preset_subdir = "units_length" preset_operator = "script.execute_preset" - draw = Menu.draw_preset + preset_add_operator = "scene.units_length_preset_add" class SCENE_UL_keying_set_paths(UIList): @@ -65,7 +66,7 @@ class SceneButtonsPanel: class SCENE_PT_scene(SceneButtonsPanel, Panel): bl_label = "Scene" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -79,18 +80,16 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel): class SCENE_PT_unit(SceneButtonsPanel, Panel): bl_label = "Units" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} + + def draw_header_preset(self, context): + SCENE_PT_units_length_presets.draw_panel_header(self.layout) def draw(self, context): layout = self.layout unit = context.scene.unit_settings - row = layout.row(align=True) - row.menu("SCENE_MT_units_length_presets", text=SCENE_MT_units_length_presets.bl_label) - row.operator("scene.units_length_preset_add", text="", icon='ZOOMIN') - row.operator("scene.units_length_preset_add", text="", icon='ZOOMOUT').remove_active = True - layout.use_property_split = True col = layout.column() @@ -161,7 +160,7 @@ class SceneKeyingSetsPanel: class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel): bl_label = "Keying Sets" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -195,7 +194,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel): class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel): bl_label = "Active Keying Set" bl_parent_id = "SCENE_PT_keying_sets" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} @classmethod def poll(cls, context): @@ -252,7 +251,7 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel): class SCENE_PT_color_management(SceneButtonsPanel, Panel): bl_label = "Color Management" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -263,7 +262,6 @@ class SCENE_PT_color_management(SceneButtonsPanel, Panel): col = layout.column() col.prop(scene.display_settings, "display_device") - col.prop(scene.sequencer_colorspace_settings, "name", text="Sequencer Color Space") col.separator() @@ -273,12 +271,16 @@ class SCENE_PT_color_management(SceneButtonsPanel, Panel): col.prop(view, "gamma") col.prop(view, "look") + col.separator() + + col.prop(scene.sequencer_colorspace_settings, "name", text="Sequencer Color Space") + class SCENE_PT_color_management_curves(SceneButtonsPanel, Panel): bl_label = "Use Curves" bl_parent_id = "SCENE_PT_color_management" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw_header(self, context): @@ -302,7 +304,7 @@ class SCENE_PT_color_management_curves(SceneButtonsPanel, Panel): class SCENE_PT_audio(SceneButtonsPanel, Panel): bl_label = "Audio" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout @@ -434,7 +436,7 @@ class SCENE_PT_rigid_body_field_weights(SceneButtonsPanel, Panel): class SCENE_PT_simplify(SceneButtonsPanel, Panel): bl_label = "Simplify" bl_options = {'DEFAULT_CLOSED'} - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw_header(self, context): rd = context.scene.render @@ -495,13 +497,13 @@ class SCENE_PT_viewport_display_ssao(SceneButtonsPanel, Panel): class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel): - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} _context_path = "scene" _property_type = bpy.types.Scene classes = ( - SCENE_MT_units_length_presets, + SCENE_PT_units_length_presets, SCENE_UL_keying_set_paths, SCENE_PT_scene, SCENE_PT_unit, diff --git a/release/scripts/startup/bl_ui/properties_view_layer.py b/release/scripts/startup/bl_ui/properties_view_layer.py index 013fac3c099..3fc003ac86e 100644 --- a/release/scripts/startup/bl_ui/properties_view_layer.py +++ b/release/scripts/startup/bl_ui/properties_view_layer.py @@ -34,7 +34,7 @@ class ViewLayerButtonsPanel: class VIEWLAYER_PT_layer(ViewLayerButtonsPanel, Panel): bl_label = "View Layer" - COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE'} + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'} def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index db2a54d6138..d4ae3121a88 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -21,6 +21,7 @@ import bpy from bpy.types import Panel, Header, Menu, UIList from bpy.app.translations import pgettext_iface as iface_ +from bl_operators.presets import PresetMenu from .properties_grease_pencil_common import ( GreasePencilDrawingToolsPanel, GreasePencilStrokeEditPanel, @@ -144,7 +145,7 @@ class CLIP_HT_header(Header): layout.prop(sc, "mode", text="") if sc.mode == 'TRACKING': - layout.prop(sc, "view", text="", icon_only=True) + layout.prop(sc, "view", text="") self._draw_tracking(context) else: self._draw_masking(context) @@ -277,6 +278,9 @@ class CLIP_PT_tracking_settings(CLIP_PT_tracking_panel, Panel): bl_label = "Tracking Settings" bl_category = "Track" + def draw_header_preset(self, context): + CLIP_PT_tracking_settings_presets.draw_panel_header(self.layout) + def draw(self, context): sc = context.space_data @@ -286,14 +290,6 @@ class CLIP_PT_tracking_settings(CLIP_PT_tracking_panel, Panel): col = layout.column() row = col.row(align=True) - label = CLIP_MT_tracking_settings_presets.bl_label - row.menu('CLIP_MT_tracking_settings_presets', text=label) - row.operator("clip.tracking_settings_preset_add", - text="", icon='ZOOMIN') - row.operator("clip.tracking_settings_preset_add", - text="", icon='ZOOMOUT').remove_active = True - - row = col.row(align=True) row.prop(settings, "use_default_red_channel", text="R", toggle=True) row.prop(settings, "use_default_green_channel", @@ -625,12 +621,8 @@ class CLIP_PT_track(CLIP_PT_tracking_panel, Panel): layout.separator() row = layout.row(align=True) - label = bpy.types.CLIP_MT_track_color_presets.bl_label - row.menu('CLIP_MT_track_color_presets', text=label) + CLIP_PT_track_color_presets.draw_menu(row, 'Color Presets') row.menu('CLIP_MT_track_color_specials', text="", icon='DOWNARROW_HLT') - row.operator("clip.track_color_preset_add", text="", icon='ZOOMIN') - row.operator("clip.track_color_preset_add", - text="", icon='ZOOMOUT').remove_active = True row = layout.row() row.prop(act_track, "use_custom_color") @@ -720,19 +712,15 @@ class CLIP_PT_tracking_camera(Panel): return False + def draw_header_preset(self, context): + CLIP_PT_camera_presets.draw_panel_header(self.layout) + def draw(self, context): layout = self.layout sc = context.space_data clip = sc.clip - row = layout.row(align=True) - label = bpy.types.CLIP_MT_camera_presets.bl_label - row.menu('CLIP_MT_camera_presets', text=label) - row.operator("clip.camera_preset_add", text="", icon='ZOOMIN') - row.operator("clip.camera_preset_add", text="", - icon='ZOOMOUT').remove_active = True - col = layout.column(align=True) col.label(text="Sensor:") col.prop(clip.tracking.camera, "sensor_width", text="Width") @@ -1431,28 +1419,28 @@ class CLIP_MT_tracking_specials(Menu): text="Unlock Tracks").action = 'UNLOCK' -class CLIP_MT_camera_presets(Menu): +class CLIP_PT_camera_presets(PresetMenu): """Predefined tracking camera intrinsics""" bl_label = "Camera Presets" preset_subdir = "tracking_camera" preset_operator = "script.execute_preset" - draw = Menu.draw_preset + preset_add_operator = "clip.camera_preset_add" -class CLIP_MT_track_color_presets(Menu): +class CLIP_PT_track_color_presets(PresetMenu): """Predefined track color""" bl_label = "Color Presets" preset_subdir = "tracking_track_color" preset_operator = "script.execute_preset" - draw = Menu.draw_preset + preset_add_operator = "clip.track_color_preset_add" -class CLIP_MT_tracking_settings_presets(Menu): +class CLIP_PT_tracking_settings_presets(PresetMenu): """Predefined tracking settings""" bl_label = "Tracking Presets" preset_subdir = "tracking_settings" preset_operator = "script.execute_preset" - draw = Menu.draw_preset + preset_add_operator = "clip.tracking_settings_preset_add" class CLIP_MT_track_color_specials(Menu): @@ -1536,9 +1524,9 @@ classes = ( CLIP_MT_select, CLIP_MT_select_grouped, CLIP_MT_tracking_specials, - CLIP_MT_camera_presets, - CLIP_MT_track_color_presets, - CLIP_MT_tracking_settings_presets, + CLIP_PT_camera_presets, + CLIP_PT_track_color_presets, + CLIP_PT_tracking_settings_presets, CLIP_MT_track_color_specials, CLIP_MT_stabilize_2d_specials, CLIP_MT_stabilize_2d_rotation_specials, diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index e8c9925ba9e..1acc8cf601d 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -19,7 +19,7 @@ # <pep8 compliant> import bpy import math -from bpy.types import Header, Menu, Panel +from bpy.types import Header, Menu, Panel, UIList from .properties_paint_common import ( UnifiedPaintPanel, brush_texture_settings, @@ -724,10 +724,41 @@ class IMAGE_PT_view_properties(Panel): row.active = uvedit.show_other_objects row.prop(uvedit, "other_uv_filter", text="Filter") - if show_render and ima: - layout.separator() - render_slot = ima.render_slots.active - layout.prop(render_slot, "name", text="Slot Name") + +class IMAGE_UL_render_slots(UIList): + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): + slot = item + layout.prop(slot, "name", text="", emboss=False) + + +class IMAGE_PT_render_slots(Panel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'UI' + bl_label = "Render Slots" + + @classmethod + def poll(cls, context): + sima = context.space_data + return (sima and sima.image and sima.show_render) + + def draw(self, context): + layout = self.layout + + sima = context.space_data + ima = sima.image + + row = layout.row() + + col = row.column() + col.template_list("IMAGE_UL_render_slots", "render_slots", ima, "render_slots", ima.render_slots, "active_index", rows=3) + + col = row.column(align=True) + col.operator("image.add_render_slot", icon='ZOOMIN', text="") + col.operator("image.remove_render_slot", icon='ZOOMOUT', text="") + + col.separator() + + col.operator("image.clear_render_slot", icon='X', text="") class IMAGE_PT_tools_transform_uvs(Panel, UVToolsPanel): @@ -1361,6 +1392,8 @@ classes = ( IMAGE_PT_active_mask_spline, IMAGE_PT_active_mask_point, IMAGE_PT_image_properties, + IMAGE_UL_render_slots, + IMAGE_PT_render_slots, IMAGE_PT_view_properties, IMAGE_PT_tools_transform_uvs, IMAGE_PT_tools_align_uvs, diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py index 2f1c1d8325e..607e2d28d0f 100644 --- a/release/scripts/startup/bl_ui/space_nla.py +++ b/release/scripts/startup/bl_ui/space_nla.py @@ -39,6 +39,7 @@ class NLA_HT_header(Header): dopesheet_filter(layout, context) + layout.separator_spacer() layout.prop(st, "auto_snap", text="") diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 1b6baa7d3d9..521c510ad2d 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -21,6 +21,7 @@ import bpy import nodeitems_utils from bpy.types import Header, Menu, Panel from bpy.app.translations import pgettext_iface as iface_ +from bl_operators.presets import PresetMenu from .properties_grease_pencil_common import ( GreasePencilDrawingToolsPanel, GreasePencilStrokeEditPanel, @@ -289,12 +290,12 @@ class NODE_MT_node(Menu): layout.operator("node.read_fullsamplelayers") -class NODE_MT_node_color_presets(Menu): +class NODE_PT_node_color_presets(PresetMenu): """Predefined node color""" bl_label = "Color Presets" preset_subdir = "node_color" preset_operator = "script.execute_preset" - draw = Menu.draw_preset + preset_add_operator = "node.node_color_preset_add" class NODE_MT_node_color_specials(Menu): @@ -373,6 +374,9 @@ class NODE_PT_active_node_color(Panel): node = context.active_node self.layout.prop(node, "use_custom_color", text="") + def draw_header_preset(self, context): + NODE_PT_node_color_presets.draw_panel_header(self.layout) + def draw(self, context): layout = self.layout node = context.active_node @@ -380,13 +384,8 @@ class NODE_PT_active_node_color(Panel): layout.enabled = node.use_custom_color row = layout.row() - col = row.column() - col.menu("NODE_MT_node_color_presets") - col.prop(node, "color", text="") - col = row.column(align=True) - col.operator("node.node_color_preset_add", text="", icon='ZOOMIN').remove_active = False - col.operator("node.node_color_preset_add", text="", icon='ZOOMOUT').remove_active = True - col.menu("NODE_MT_node_color_specials", text="", icon='DOWNARROW_HLT') + row.prop(node, "color", text="") + row.menu("NODE_MT_node_color_specials", text="", icon='DOWNARROW_HLT') class NODE_PT_active_node_properties(Panel): @@ -585,7 +584,7 @@ classes = ( NODE_MT_view, NODE_MT_select, NODE_MT_node, - NODE_MT_node_color_presets, + NODE_PT_node_color_presets, NODE_MT_node_color_specials, NODE_MT_specials, NODE_PT_active_node_generic, diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index 12cff72b61a..f825546bb47 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -186,7 +186,7 @@ class OUTLINER_MT_collection(Menu): layout.menu("OUTLINER_MT_collection_view_layer") layout.separator() - layout.operator_menu_enum("outliner.id_operation", 'type', text="ID Data") + layout.operator_menu_enum("outliner.id_operation", "type", text="ID Data") class OUTLINER_MT_collection_new(Menu): @@ -205,6 +205,8 @@ class OUTLINER_MT_object(Menu): layout = self.layout space = context.space_data + obj = context.active_object + object_mode = 'OBJECT' if obj is None else obj.mode layout.operator("outliner.object_operation", text="Delete").type = 'DELETE' if space.display_mode == 'VIEW_LAYER' and not space.use_filter_collection: @@ -218,11 +220,19 @@ class OUTLINER_MT_object(Menu): layout.separator() + if object_mode in {'EDIT', 'POSE'}: + name = bpy.types.Object.bl_rna.properties["mode"].enum_items[object_mode].name + layout.operator("outliner.object_operation", text=f"{name} Set").type = 'OBJECT_MODE_ENTER' + layout.operator("outliner.object_operation", text=f"{name} Clear").type = 'OBJECT_MODE_EXIT' + del name + + layout.separator() + if not (space.display_mode == 'VIEW_LAYER' and not space.use_filter_collection): layout.operator("outliner.id_operation", text="Unlink").type = 'UNLINK' layout.separator() - layout.operator_menu_enum("outliner.id_operation", 'type', text="ID Data") + layout.operator_menu_enum("outliner.id_operation", "type", text="ID Data") class OUTLINER_PT_filter(Panel): diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index da86c1c03bc..c1331425572 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -98,17 +98,18 @@ class _defs_view3d_generic: @ToolDef.from_fn def cursor_click(): return dict( - text="Cursor Click", + text="None", icon="ops.generic.cursor", keymap=( - ("view3d.cursor3d", dict(), dict(type='ACTIONMOUSE', value='CLICK')), + # This is a dummy keymap entry, until particle system is properly working with toolsystem. + ("view3d.cursor3d", dict(), dict(type='ACTIONMOUSE', value='CLICK', ctrl=True, alt=True, shift=True)), ), ) @ToolDef.from_fn def ruler(): return dict( - text="Ruler/Protractor", + text="Ruler", icon="ops.view3d.ruler", widget="VIEW3D_WGT_ruler", keymap=( diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 0171d98af0b..5ea5923c1e0 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -91,20 +91,6 @@ class TOPBAR_HT_lower_bar(Header): def draw_left(self, context): layout = self.layout - layer = context.view_layer - object = layer.objects.active - - # Object Mode - # ----------- - object_mode = 'OBJECT' if object is None else object.mode - act_mode_item = bpy.types.Object.bl_rna.properties['mode'].enum_items[object_mode] - - layout.operator_menu_enum("object.mode_set", "mode", text=act_mode_item.name, icon=act_mode_item.icon) - - layout.template_header_3D_mode() - - def draw_center(self, context): - layout = self.layout mode = context.mode # Active Tool @@ -143,6 +129,9 @@ class TOPBAR_HT_lower_bar(Header): elif mode == 'PARTICLE': layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".paint_common", category="") + def draw_center(self, context): + pass + def draw_right(self, context): layout = self.layout @@ -169,110 +158,6 @@ class TOPBAR_HT_lower_bar(Header): elif mode == 'PARTICLE': layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".particlemode", category="") - # 3D View Options, tsk. maybe users aren't always using 3D view? - toolsettings = context.tool_settings - scene = context.scene - obj = context.active_object - - object_mode = 'OBJECT' if obj is None else obj.mode - - # Pivot & Orientation - pivot_point = context.tool_settings.transform_pivot_point - act_pivot_point = bpy.types.ToolSettings.bl_rna.properties['transform_pivot_point'].enum_items[pivot_point] - - row = layout.row(align=True) - row.popover( - space_type='TOPBAR', - region_type='HEADER', - panel_type="TOPBAR_PT_pivot_point", - icon=act_pivot_point.icon, - text="", - ) - - if obj: - # Proportional editing - if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode: - row = layout.row(align=True) - row.prop(toolsettings, "proportional_edit", icon_only=True) - - sub = row.row(align=True) - sub.active = toolsettings.proportional_edit != 'DISABLED' - sub.prop(toolsettings, "proportional_edit_falloff", icon_only=True) - - elif object_mode in {'EDIT', 'PARTICLE_EDIT'}: - row = layout.row(align=True) - row.prop(toolsettings, "proportional_edit", icon_only=True) - sub = row.row(align=True) - sub.active = toolsettings.proportional_edit != 'DISABLED' - sub.prop(toolsettings, "proportional_edit_falloff", icon_only=True) - - elif object_mode == 'OBJECT': - row = layout.row(align=True) - row.prop(toolsettings, "use_proportional_edit_objects", icon_only=True) - sub = row.row(align=True) - sub.active = toolsettings.use_proportional_edit_objects - sub.prop(toolsettings, "proportional_edit_falloff", icon_only=True) - else: - # Proportional editing - if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode: - row = layout.row(align=True) - row.prop(toolsettings, "proportional_edit", icon_only=True) - sub = row.row(align=True) - sub.active = toolsettings.proportional_edit != 'DISABLED' - sub.prop(toolsettings, "proportional_edit_falloff", icon_only=True) - - # Snap - show_snap = False - if obj is None: - show_snap = True - else: - if object_mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}: - show_snap = True - else: - - from .properties_paint_common import UnifiedPaintPanel - paint_settings = UnifiedPaintPanel.paint_settings(context) - - if paint_settings: - brush = paint_settings.brush - if brush and brush.stroke_method == 'CURVE': - show_snap = True - - if show_snap: - snap_items = bpy.types.ToolSettings.bl_rna.properties['snap_elements'].enum_items - for elem in toolsettings.snap_elements: - # TODO: Display multiple icons. - # (Currently only one of the enabled modes icons is displayed) - icon = snap_items[elem].icon - break - else: - icon = 'NONE' - - row = layout.row(align=True) - row.prop(toolsettings, "use_snap", text="") - - sub = row.row(align=True) - sub.popover( - space_type='TOPBAR', - region_type='HEADER', - panel_type="TOPBAR_PT_snapping", - icon=icon, - text="" - ) - - layout.prop(scene, "transform_orientation", text="") - - # Command Settings (redo) - op = context.active_operator - row = layout.row() - row.enabled = op is not None - row.popover( - space_type='TOPBAR', - region_type='HEADER', - panel_type="TOPBAR_PT_redo", - text=op.name + " Settings" if op else "Command Settings", - ) - class _draw_left_context_mode: @staticmethod @@ -384,11 +269,6 @@ class TOPBAR_PT_snapping(Panel): if 'VOLUME' in snap_elements: col.prop(toolsettings, "use_snap_peel_object") - # Auto-Merge Editing - if obj: - if (object_mode == 'EDIT' and obj.type == 'MESH'): - col.prop(toolsettings, "use_mesh_automerge", icon='AUTOMERGE_ON') - class INFO_MT_editor_menus(Menu): bl_idname = "INFO_MT_editor_menus" @@ -619,6 +499,12 @@ class INFO_MT_edit(Menu): layout.separator() + # Should move elsewhere (impacts outliner & 3D view). + tool_settings = context.tool_settings + layout.prop(tool_settings, "lock_object_mode") + + layout.separator() + layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES') diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index a480fa433e1..e7f667f5d5f 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -545,6 +545,10 @@ class USERPREF_PT_system(Panel): col.prop(system, "use_region_overlap") col.separator() + col.label(text="Max Viewport Anti-aliasing Method") + col.prop(system, "max_anti_alias_method", text="") + + col.separator() col.label(text="Text Draw Options:") col.prop(system, "use_text_antialiasing") @@ -1609,10 +1613,12 @@ class StudioLightPanelMixin(): box = layout.box() row = box.row() - row.template_icon_view(studio_light, "icon_id") + row.template_icon(layout.icon(studio_light), scale=6.0) op = row.operator('wm.studiolight_uninstall', text="", icon='ZOOMOUT') op.index = studio_light.index + box.label(text=studio_light.name) + class USERPREF_PT_studiolight_matcaps(Panel, StudioLightPanelMixin): bl_label = "MatCaps" diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index c967fe3ad08..e780880b1bd 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -38,43 +38,41 @@ class VIEW3D_HT_header(Header): # mode_string = context.mode obj = context.active_object overlay = view.overlay - toolsettings = context.tool_settings + tool_settings = context.tool_settings row = layout.row(align=True) row.template_header() - mode = 'OBJECT' if obj is None else obj.mode + object_mode = 'OBJECT' if obj is None else obj.mode - # Testing move mode to topbar. - ''' - act_mode_item = bpy.types.Object.bl_rna.properties['mode'].enum_items[mode] + act_mode_item = bpy.types.Object.bl_rna.properties["mode"].enum_items[object_mode] layout.operator_menu_enum("object.mode_set", "mode", text=act_mode_item.name, icon=act_mode_item.icon) del act_mode_item layout.template_header_3D_mode() - ''' # Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode... shading_type = view.shading.type - shading_item = bpy.types.View3DShading.bl_rna.properties['type'].enum_items[shading_type] + shading_item = bpy.types.View3DShading.bl_rna.properties["type"].enum_items[shading_type] if obj: # Set above: - # mode = obj.mode + # object_mode = obj.mode # Particle edit - if mode == 'PARTICLE_EDIT': + if object_mode == 'PARTICLE_EDIT': row = layout.row() - row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True) + row.prop(tool_settings.particle_edit, "select_mode", text="", expand=True) # Occlude geometry - if ((shading.type not in {'BOUNDBOX', 'WIREFRAME'} and (mode == 'PARTICLE_EDIT' or (mode == 'EDIT' and obj.type == 'MESH'))) or - (mode in {'WEIGHT_PAINT', 'VERTEX_PAINT'})): + if ((((shading.type not in {'SOLID', 'TEXTURED'}) or not shading.show_xray) and + (object_mode == 'PARTICLE_EDIT' or (object_mode == 'EDIT' and obj.type == 'MESH'))) or + (object_mode in {'WEIGHT_PAINT', 'VERTEX_PAINT'})): row = layout.row() row.prop(view, "use_occlude_geometry", text="") # Pose - if obj and mode == 'POSE': + if obj and object_mode == 'POSE': row = layout.row(align=True) row.operator("pose.copy", text="", icon='COPYDOWN') row.operator("pose.paste", text="", icon='PASTEDOWN').flipped = False @@ -90,13 +88,105 @@ class VIEW3D_HT_header(Header): layout.prop(context.gpencil_data, "use_onion_skinning", text="Onion Skins", icon='PARTICLE_PATH') row = layout.row(align=True) - row.prop(context.tool_settings.gpencil_sculpt, "use_select_mask") - row.prop(context.tool_settings.gpencil_sculpt, "selection_alpha", slider=True) + row.prop(tool_settings.gpencil_sculpt, "use_select_mask") + row.prop(tool_settings.gpencil_sculpt, "selection_alpha", slider=True) VIEW3D_MT_editor_menus.draw_collapsible(context, layout) layout.separator_spacer() + # Mode & Transform Settings + scene = context.scene + + # Orientation & Pivot + if object_mode in {'OBJECT', 'EDIT', 'POSE'}: + layout.prop(scene, "transform_orientation", text="") + + pivot_point = tool_settings.transform_pivot_point + act_pivot_point = bpy.types.ToolSettings.bl_rna.properties["transform_pivot_point"].enum_items[pivot_point] + row = layout.row(align=True) + row.popover( + space_type='TOPBAR', + region_type='HEADER', + panel_type="TOPBAR_PT_pivot_point", + icon=act_pivot_point.icon, + text="", + ) + + if obj: + # Proportional editing + if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode: + row = layout.row(align=True) + row.prop(tool_settings, "proportional_edit", icon_only=True) + + sub = row.row(align=True) + sub.active = tool_settings.proportional_edit != 'DISABLED' + sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True) + + elif object_mode in {'EDIT', 'PARTICLE_EDIT'}: + row = layout.row(align=True) + row.prop(tool_settings, "proportional_edit", icon_only=True) + sub = row.row(align=True) + sub.active = tool_settings.proportional_edit != 'DISABLED' + sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True) + + elif object_mode == 'OBJECT': + row = layout.row(align=True) + row.prop(tool_settings, "use_proportional_edit_objects", icon_only=True) + sub = row.row(align=True) + sub.active = tool_settings.use_proportional_edit_objects + sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True) + else: + # Proportional editing + if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode: + row = layout.row(align=True) + row.prop(tool_settings, "proportional_edit", icon_only=True) + sub = row.row(align=True) + sub.active = tool_settings.proportional_edit != 'DISABLED' + sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True) + + # Snap + show_snap = False + if obj is None: + show_snap = True + else: + if object_mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}: + show_snap = True + else: + + from .properties_paint_common import UnifiedPaintPanel + paint_settings = UnifiedPaintPanel.paint_settings(context) + + if paint_settings: + brush = paint_settings.brush + if brush and brush.stroke_method == 'CURVE': + show_snap = True + + if show_snap: + snap_items = bpy.types.ToolSettings.bl_rna.properties['snap_elements'].enum_items + for elem in tool_settings.snap_elements: + # TODO: Display multiple icons. + # (Currently only one of the enabled modes icons is displayed) + icon = snap_items[elem].icon + break + else: + icon = 'NONE' + + row = layout.row(align=True) + row.prop(tool_settings, "use_snap", text="") + + sub = row.row(align=True) + sub.popover( + space_type='TOPBAR', + region_type='HEADER', + panel_type="TOPBAR_PT_snapping", + icon=icon, + text="" + ) + + layout.separator_spacer() + + # Viewport Settings row = layout.row(align=True) row.prop(shading, "type", text="", expand=True) @@ -126,54 +216,56 @@ class VIEW3D_MT_editor_menus(Menu): edit_object = context.edit_object gp_edit = context.gpencil_data and context.gpencil_data.use_stroke_edit_mode - layout.menu("VIEW3D_MT_view") + # Use aligned row to squeeze out a bit more space. + row = layout.row(align=True) + row.menu("VIEW3D_MT_view") # Select Menu if gp_edit: - layout.menu("VIEW3D_MT_select_gpencil") + row.menu("VIEW3D_MT_select_gpencil") elif mode_string in {'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'}: mesh = obj.data if mesh.use_paint_mask: - layout.menu("VIEW3D_MT_select_paint_mask") + row.menu("VIEW3D_MT_select_paint_mask") elif mesh.use_paint_mask_vertex and mode_string in {'PAINT_WEIGHT', 'PAINT_VERTEX'}: - layout.menu("VIEW3D_MT_select_paint_mask_vertex") + row.menu("VIEW3D_MT_select_paint_mask_vertex") elif mode_string != 'SCULPT': - layout.menu("VIEW3D_MT_select_%s" % mode_string.lower()) + row.menu("VIEW3D_MT_select_%s" % mode_string.lower()) if gp_edit: pass elif mode_string == 'OBJECT': - layout.menu("INFO_MT_add", text="Add") + row.menu("INFO_MT_add", text="Add") elif mode_string == 'EDIT_MESH': - layout.menu("INFO_MT_mesh_add", text="Add") + row.menu("INFO_MT_mesh_add", text="Add") elif mode_string == 'EDIT_CURVE': - layout.menu("INFO_MT_curve_add", text="Add") + row.menu("INFO_MT_curve_add", text="Add") elif mode_string == 'EDIT_SURFACE': - layout.menu("INFO_MT_surface_add", text="Add") + row.menu("INFO_MT_surface_add", text="Add") elif mode_string == 'EDIT_METABALL': - layout.menu("INFO_MT_metaball_add", text="Add") + row.menu("INFO_MT_metaball_add", text="Add") elif mode_string == 'EDIT_ARMATURE': - layout.menu("INFO_MT_edit_armature_add", text="Add") + row.menu("INFO_MT_edit_armature_add", text="Add") if gp_edit: - layout.menu("VIEW3D_MT_edit_gpencil") + row.menu("VIEW3D_MT_edit_gpencil") elif edit_object: - layout.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower()) + row.menu("VIEW3D_MT_edit_%s" % edit_object.type.lower()) if mode_string == 'EDIT_MESH': - layout.menu("VIEW3D_MT_edit_mesh_vertices") - layout.menu("VIEW3D_MT_edit_mesh_edges") - layout.menu("VIEW3D_MT_edit_mesh_faces") + row.menu("VIEW3D_MT_edit_mesh_vertices") + row.menu("VIEW3D_MT_edit_mesh_edges") + row.menu("VIEW3D_MT_edit_mesh_faces") elif obj: if mode_string != 'PAINT_TEXTURE': - layout.menu("VIEW3D_MT_%s" % mode_string.lower()) + row.menu("VIEW3D_MT_%s" % mode_string.lower()) if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}: - layout.menu("VIEW3D_MT_brush") + row.menu("VIEW3D_MT_brush") if mode_string == 'SCULPT': - layout.menu("VIEW3D_MT_hide_mask") + row.menu("VIEW3D_MT_hide_mask") else: - layout.menu("VIEW3D_MT_object") + row.menu("VIEW3D_MT_object") # ********** Menu ********** @@ -396,12 +488,12 @@ class VIEW3D_MT_edit_proportional(Menu): def draw(self, context): layout = self.layout - layout.props_enum(context.tool_settings, "proportional_edit") + layout.props_enum(tool_settings, "proportional_edit") layout.separator() layout.label("Falloff:") - layout.props_enum(context.tool_settings, "proportional_edit_falloff") + layout.props_enum(tool_settings, "proportional_edit_falloff") # ********** View menus ********** @@ -414,8 +506,8 @@ class VIEW3D_MT_view(Menu): layout = self.layout view = context.space_data - layout.operator("view3d.toolshelf", icon='MENU_PANEL', text="Show Toolbar") - layout.operator("view3d.properties", icon='MENU_PANEL', text="Show Sidebar") + layout.operator("view3d.toolshelf", icon='MENU_PANEL') + layout.operator("view3d.properties", icon='MENU_PANEL') layout.separator() @@ -755,7 +847,8 @@ class VIEW3D_MT_edit_mesh_select_by_trait(Menu): def draw(self, context): layout = self.layout - if context.scene.tool_settings.mesh_select_mode[2] is False: + tool_settings = context.tool_settings + if tool_settings.mesh_select_mode[2] is False: layout.operator("mesh.select_non_manifold", text="Non Manifold") layout.operator("mesh.select_loose", text="Loose Geometry") layout.operator("mesh.select_interior_faces", text="Interior Faces") @@ -1424,6 +1517,10 @@ class VIEW3D_MT_object(Menu): layout.separator() + layout.menu("VIEW3D_MT_object_showhide") + + layout.separator() + layout.operator("object.delete", text="Delete...").use_global = False @@ -1780,6 +1877,20 @@ class VIEW3D_MT_object_quick_effects(Menu): layout.operator("object.quick_fluid") +class VIEW3D_MT_object_showhide(Menu): + bl_label = "Show/Hide" + + def draw(self, context): + layout = self.layout + + layout.operator("object.hide_view_clear", text="Show Hidden") + + layout.separator() + + layout.operator("object.hide_view_set", text="Hide Selected").unselected = False + layout.operator("object.hide_view_set", text="Hide Unselected").unselected = True + + class VIEW3D_MT_make_single_user(Menu): bl_label = "Make Single User" @@ -1836,10 +1947,11 @@ class VIEW3D_MT_brush(Menu): def draw(self, context): layout = self.layout + tool_settings = context.tool_settings settings = UnifiedPaintPanel.paint_settings(context) brush = getattr(settings, "brush", None) - ups = context.tool_settings.unified_paint_settings + ups = tool_settings.unified_paint_settings layout.prop(ups, "use_unified_size", text="Unified Size") layout.prop(ups, "use_unified_strength", text="Unified Strength") if context.image_paint_object or context.vertex_paint_object: @@ -2022,8 +2134,8 @@ class VIEW3D_MT_sculpt(Menu): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - sculpt = toolsettings.sculpt + tool_settings = context.tool_settings + sculpt = tool_settings.sculpt layout.prop(sculpt, "use_symmetry_x") layout.prop(sculpt, "use_symmetry_y") @@ -2089,8 +2201,9 @@ class VIEW3D_MT_particle(Menu): def draw(self, context): layout = self.layout + tool_settings = context.tool_settings - particle_edit = context.tool_settings.particle_edit + particle_edit = tool_settings.particle_edit layout.operator("particle.mirror") @@ -2119,8 +2232,9 @@ class VIEW3D_MT_particle_specials(Menu): def draw(self, context): layout = self.layout + tool_settings = context.tool_settings - particle_edit = context.tool_settings.particle_edit + particle_edit = tool_settings.particle_edit layout.operator("particle.rekey") @@ -2455,9 +2569,9 @@ class VIEW3D_MT_edit_mesh(Menu): def draw(self, context): layout = self.layout + tool_settings = context.tool_settings with_bullet = bpy.app.build_options.bullet - toolsettings = context.tool_settings layout.menu("VIEW3D_MT_transform") layout.menu("VIEW3D_MT_mirror") @@ -2618,8 +2732,9 @@ class VIEW3D_MT_edit_mesh_extrude(Menu): @staticmethod def extrude_options(context): + tool_settings = context.tool_settings + select_mode = tool_settings.mesh_select_mode mesh = context.object.data - select_mode = context.tool_settings.mesh_select_mode menu = [] if mesh.total_face_sel: @@ -3334,7 +3449,7 @@ class VIEW3D_MT_edit_gpencil(Menu): bl_label = "GPencil" def draw(self, context): - toolsettings = context.tool_settings + tool_settings = context.tool_settings layout = self.layout @@ -3345,7 +3460,7 @@ class VIEW3D_MT_edit_gpencil(Menu): layout.separator() layout.operator("gpencil.brush_paint", text="Sculpt Strokes").wait_for_input = True - layout.prop_menu_enum(toolsettings.gpencil_sculpt, "tool", text="Sculpt Brush") + layout.prop_menu_enum(tool_settings.gpencil_sculpt, "tool", text="Sculpt Brush") layout.separator() @@ -3420,7 +3535,7 @@ class VIEW3D_MT_edit_gpencil_interpolate(Menu): layout.operator("gpencil.interpolate_sequence", text="Sequence") -class VIEW3D_PIE_object_mode(Menu): +class VIEW3D_MT_object_mode_pie(Menu): bl_label = "Mode" def draw(self, context): @@ -3430,9 +3545,9 @@ class VIEW3D_PIE_object_mode(Menu): pie.operator_enum("OBJECT_OT_mode_set", "mode") -class VIEW3D_PIE_view(Menu): +class VIEW3D_MT_view_pie(Menu): bl_label = "View" - bl_idname = "VIEW3D_PIE_view" + bl_idname = "VIEW3D_MT_view_pie" def draw(self, context): layout = self.layout @@ -3534,84 +3649,128 @@ class VIEW3D_PT_shading(Panel): return True def draw(self, context): + pass + + +class VIEW3D_PT_shading_lighting(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'HEADER' + bl_label = "Lighting" + bl_parent_id = 'VIEW3D_PT_shading' + + @classmethod + def poll(cls, context): + return True + + def draw(self, context): layout = self.layout view = context.space_data shading = view.shading - col = layout.column() - col.row().label("Lighting") if shading.type in ('SOLID', 'TEXTURED'): - col.row().prop(shading, "light", expand=True) + layout.row().prop(shading, "light", expand=True) if shading.light == 'STUDIO': - row = col.row() - row.template_icon_view(shading, "studio_light") + row = layout.row() + row.template_icon_view(shading, "studio_light", show_labels=True) sub = row.column() sub.operator('wm.studiolight_userpref_show', emboss=False, text="", icon='PREFERENCES') if shading.selected_studio_light.orientation == 'WORLD': - col.row().prop(shading, "studiolight_rot_z") + layout.row().prop(shading, "studiolight_rot_z") elif shading.light == 'MATCAP': - row = col.row() - row.template_icon_view(shading, "studio_light") + row = layout.row() + row.template_icon_view(shading, "studio_light", show_labels=True) sub = row.column() sub.operator('VIEW3D_OT_toggle_matcap_flip', emboss=False, text="", icon='ARROW_LEFTRIGHT') sub.operator('wm.studiolight_userpref_show', emboss=False, text="", icon='PREFERENCES') - if shading.type == 'SOLID': - col.separator() - col.row().label("Color") - col.row().prop(shading, "color_type", expand=True) - - if shading.color_type == 'SINGLE': - col.row().prop(shading, "single_color", text="") - - if shading.type in ('SOLID', 'TEXTURED'): - col.separator() - - if not shading.light == 'MATCAP': - row = col.row() - row.prop(shading, "show_specular_highlight") - - if shading.type in ('SOLID', 'TEXTURED'): - row = col.split(0.4) - row.prop(shading, "show_xray") - sub = row.row() - sub.active = shading.show_xray - sub.prop(shading, "xray_alpha", text="") - - row = col.split(0.4) - row.active = not shading.show_xray - row.prop(shading, "show_shadows") - sub = row.row() - sub.active = shading.show_shadows and not shading.show_xray - sub.prop(shading, "shadow_intensity", text="") - - row = col.split(0.4) - row.active = not shading.show_xray - row.prop(shading, "show_cavity") - sub = row.column(align=True) - sub.active = not shading.show_xray and shading.show_cavity - sub.prop(shading, "cavity_ridge_factor") - sub.prop(shading, "cavity_valley_factor") - - row = col.split(0.4) - row.prop(shading, "show_object_outline") - sub = row.row() - sub.active = shading.show_object_outline - sub.prop(shading, "object_outline_color", text="") - - col.prop(view, "show_world") - elif shading.type in ('MATERIAL'): - row = col.row() - row.template_icon_view(shading, "studio_light") + row = layout.row() + row.template_icon_view(shading, "studio_light", show_labels=True) sub = row.column() sub.operator('wm.studiolight_userpref_show', emboss=False, text="", icon='PREFERENCES') if shading.selected_studio_light.orientation == 'WORLD': - col.row().prop(shading, "studiolight_rot_z") - col.row().prop(shading, "studiolight_background") - col.prop(shading, "use_scene_light") + layout.row().prop(shading, "studiolight_rot_z") + layout.row().prop(shading, "studiolight_background_alpha") + layout.prop(shading, "use_scene_light") + + +class VIEW3D_PT_shading_color(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'HEADER' + bl_label = "Color" + bl_parent_id = 'VIEW3D_PT_shading' + + @classmethod + def poll(cls, context): + view = context.space_data + shading = view.shading + return shading.type in ['SOLID'] + + def draw(self, context): + layout = self.layout + + view = context.space_data + shading = view.shading + + layout.row().prop(shading, "color_type", expand=True) + + if shading.color_type == 'SINGLE': + layout.row().prop(shading, "single_color", text="") + + +class VIEW3D_PT_shading_options(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'HEADER' + bl_label = "Options" + bl_parent_id = 'VIEW3D_PT_shading' + + @classmethod + def poll(cls, context): + view = context.space_data + shading = view.shading + return shading.type in ['SOLID', 'TEXTURED'] + + def draw(self, context): + layout = self.layout + + view = context.space_data + shading = view.shading + + if not shading.light == 'MATCAP': + row = layout.row() + row.prop(shading, "show_specular_highlight") + + if shading.type in ('SOLID', 'TEXTURED'): + row = layout.split(0.4) + row.prop(shading, "show_xray") + sub = row.row() + sub.active = shading.show_xray + sub.prop(shading, "xray_alpha", text="") + + row = layout.split(0.4) + row.active = not shading.show_xray + row.prop(shading, "show_shadows") + sub = row.row() + sub.active = shading.show_shadows and not shading.show_xray + sub.prop(shading, "shadow_intensity", text="") + + row = layout.split(0.4) + row.active = not shading.show_xray + row.prop(shading, "show_cavity") + sub = row.column(align=True) + sub.active = not shading.show_xray and shading.show_cavity + sub.prop(shading, "cavity_ridge_factor") + sub.prop(shading, "cavity_valley_factor") + + row = layout.split(0.4) + row.prop(shading, "show_object_outline") + sub = row.row() + sub.active = shading.show_object_outline + sub.prop(shading, "object_outline_color", text="") + + layout.prop(view, "show_world") class VIEW3D_PT_overlay(Panel): @@ -3629,7 +3788,6 @@ class VIEW3D_PT_overlay(Panel): view = context.space_data shading = view.shading overlay = view.overlay - toolsettings = context.tool_settings display_all = overlay.show_overlays col = layout.column() @@ -3705,10 +3863,10 @@ class VIEW3D_PT_overlay_edit_mesh(Panel): view = context.space_data shading = view.shading overlay = view.overlay - toolsettings = context.tool_settings + tool_settings = context.tool_settings display_all = overlay.show_overlays data = context.active_object.data - statvis = context.tool_settings.statvis + statvis = tool_settings.statvis with_freestyle = bpy.app.build_options.freestyle col = layout.column() @@ -3756,7 +3914,7 @@ class VIEW3D_PT_overlay_edit_mesh(Panel): col.prop(overlay, "show_weight") if overlay.show_weight: col.label("Show Zero Weights:") - col.row().prop(toolsettings, "vertex_group_user", expand=True) + col.row().prop(tool_settings, "vertex_group_user", expand=True) col.prop(data, "show_statvis", text="Mesh Analysis") if data.show_statvis: @@ -3827,8 +3985,8 @@ class VIEW3D_PT_overlay_sculpt(Panel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - sculpt = toolsettings.sculpt + tool_settings = context.tool_settings + sculpt = tool_settings.sculpt layout.prop(sculpt, "show_diffuse_color") layout.prop(sculpt, "show_mask") @@ -4009,10 +4167,10 @@ class VIEW3D_PT_context_properties(Panel): def _active_context_member(context): obj = context.object if obj: - mode = obj.mode - if mode == 'POSE': + object_mode = obj.mode + if object_mode == 'POSE': return "active_pose_bone" - elif mode == 'EDIT' and obj.type == 'ARMATURE': + elif object_mode == 'EDIT' and obj.type == 'ARMATURE': return "active_bone" else: return "object" @@ -4101,6 +4259,7 @@ classes = ( VIEW3D_MT_object_collection, VIEW3D_MT_object_constraints, VIEW3D_MT_object_quick_effects, + VIEW3D_MT_object_showhide, VIEW3D_MT_make_single_user, VIEW3D_MT_make_links, VIEW3D_MT_brush, @@ -4167,8 +4326,8 @@ classes = ( VIEW3D_MT_edit_armature_delete, VIEW3D_MT_edit_gpencil_transform, VIEW3D_MT_edit_gpencil_interpolate, - VIEW3D_PIE_object_mode, - VIEW3D_PIE_view, + VIEW3D_MT_object_mode_pie, + VIEW3D_MT_view_pie, VIEW3D_PT_grease_pencil, VIEW3D_PT_grease_pencil_palettecolor, VIEW3D_PT_view3d_properties, @@ -4176,6 +4335,9 @@ classes = ( VIEW3D_PT_quad_view, VIEW3D_PT_view3d_stereo, VIEW3D_PT_shading, + VIEW3D_PT_shading_lighting, + VIEW3D_PT_shading_color, + VIEW3D_PT_shading_options, VIEW3D_PT_overlay, VIEW3D_PT_overlay_edit_mesh, VIEW3D_PT_overlay_edit_curve, diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index a7469104b17..390c5bd0abd 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -104,6 +104,8 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel): col.prop(tool_settings, "edge_path_live_unwrap") col.label("Double Threshold:") col.prop(tool_settings, "double_threshold", text="") + col.prop(tool_settings, "use_mesh_automerge") # , icon='AUTOMERGE_ON' + # ********** default tools for editmode_curve **************** diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index d60710db4aa..713dbdafcc5 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -177,6 +177,7 @@ shader_node_categories = [ NodeItem("ShaderNodeNewGeometry"), NodeItem("ShaderNodeWireframe"), NodeItem("ShaderNodeBevel"), + NodeItem("ShaderNodeAmbientOcclusion"), NodeItem("ShaderNodeObjectInfo"), NodeItem("ShaderNodeHairInfo"), NodeItem("ShaderNodeParticleInfo"), @@ -209,7 +210,6 @@ shader_node_categories = [ NodeItem("ShaderNodeEmission", poll=object_eevee_cycles_shader_nodes_poll), NodeItem("ShaderNodeBsdfHair", poll=object_cycles_shader_nodes_poll), NodeItem("ShaderNodeBackground", poll=world_shader_nodes_poll), - NodeItem("ShaderNodeAmbientOcclusion", poll=object_eevee_cycles_shader_nodes_poll), NodeItem("ShaderNodeHoldout", poll=object_cycles_shader_nodes_poll), NodeItem("ShaderNodeVolumeAbsorption", poll=eevee_cycles_shader_nodes_poll), NodeItem("ShaderNodeVolumeScatter", poll=eevee_cycles_shader_nodes_poll), diff --git a/release/windows/blendthumb/CMakeLists.txt b/release/windows/blendthumb/CMakeLists.txt index 1e5f5131a36..f0da43c2614 100644 --- a/release/windows/blendthumb/CMakeLists.txt +++ b/release/windows/blendthumb/CMakeLists.txt @@ -26,17 +26,18 @@ #----------------------------------------------------------------------------- cmake_minimum_required(VERSION 2.8) project(BlendThumb) - + #Bring the headers, such as Student.h into the project include_directories(${ZLIB_INCLUDE}) - + #Can manually add the sources using the set command as follows: -set(SOURCES src/BlenderThumb.cpp - src/BlendThumb.def - src/BlendThumb.rc - src/Dll.cpp +set(SRC + src/BlenderThumb.cpp + src/BlendThumb.def + src/BlendThumb.rc + src/Dll.cpp ) - -add_library(BlendThumb SHARED ${SOURCES}) + +add_library(BlendThumb SHARED ${SRC}) target_link_libraries(BlendThumb ${ZLIB_LIBS}) install (TARGETS BlendThumb DESTINATION bin) |