diff --git a/LICENSE b/LICENSE index bba52ae..4e24b20 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. diff --git a/README.md b/README.md index 524f2f9..e7e38cf 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@

Welcome to
- BakeMaster 2.6.1 Blender Add-on + BakeMaster 2.6.2 Blender Add-on

BakeMaster is an add-on specified for baking various texture maps
and created for Blender - open-source 3D Computer graphics software.
Along with its intuitive and convenient workflow baking process becomes a pleasure.
Created from scratch for users who can't stand wasting time,
and yearn for most functionality and cutting-edge features. - + Documentation Status diff --git a/__init__.py b/__init__.py index d859066..9dd6e80 100644 --- a/__init__.py +++ b/__init__.py @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. @@ -38,7 +38,7 @@ "description": "Bake various PBR, Masks, and Cycles maps with ease and " "comfort", "author": "Kiril Strezikozin (aka kemplerart)", - "version": (2, 6, 1), + "version": (2, 6, 2), "blender": (2, 83, 0), "location": "View3D > Sidebar > BakeMaster", "warning": "", diff --git a/build_files/utils/make_build_archive.py b/build_files/utils/make_build_archive.py index 607c825..32fd13a 100755 --- a/build_files/utils/make_build_archive.py +++ b/build_files/utils/make_build_archive.py @@ -2,7 +2,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. diff --git a/decal.py b/decal.py index 92ecaac..f7c42af 100644 --- a/decal.py +++ b/decal.py @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. diff --git a/docs/conf.py b/docs/conf.py index c09bdbc..be22cb6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,7 @@ copyright = ': 2022-2024, Kiril Strezikozin' author = 'kemplerart' version = bakemaster_version -branch = "release-2.6.1" +branch = "release-2.6.2" # The full version, including alpha/beta/rc tags release = bakemaster_version @@ -216,7 +216,7 @@ # every page bottom, using the given strftime() format. # The empty string is equivalent to '%b %d, %Y' # (or a locale-dependent equivalent). -html_last_updated_fmt = '24/02/2024' +html_last_updated_fmt = '17/03/2024' # If true, the reST sources are included in the HTML build as _sources/name. html_copy_source = True diff --git a/docs/pages/more/releases.rst b/docs/pages/more/releases.rst index 81abf05..d74a146 100644 --- a/docs/pages/more/releases.rst +++ b/docs/pages/more/releases.rst @@ -7,6 +7,28 @@ Releases All BakeMaster Releases and Changelogs are listed on this page. Each new release comes with new features, improvements, or fixes. For clarity, each section has a ``tag`` to identify the changes. +2.6.2 Release +============= + +.. admonition:: Tag + :class: important + + `2.6.2 - March 17th, 2024 `__ + +**Fixes:** + +#. **Multires bakes accidentally read wrong bake settings** (`issue81 `__). +#. Snap UV to pixels doesn't work (res_x undefined) (`issue83 `__). + +**New Features:** + +#. Toggle hide/not hide ShaderNodes in baked materials (`issue84 `__). +#. ``$materialname`` **keyword for batch name** (`issue86 `__). + +**Changes:** + +#. ``$mapname`` defaults to channel pack when map is in one (`issue87 `__). + 2.6.1 Release ============= diff --git a/docs/pages/setup/compatibility.rst b/docs/pages/setup/compatibility.rst index dc7b19d..def163b 100644 --- a/docs/pages/setup/compatibility.rst +++ b/docs/pages/setup/compatibility.rst @@ -21,5 +21,6 @@ BakeMaster is compatible with the following Blender versions: * ``Blender 3.4`` * ``Blender 3.5`` * ``Blender 3.6`` +* ``Blender 4.0`` Using the addon on versions higher than specified may cause errors. If you face any compatibility errors, please `inform <../more/connect.html>`__. diff --git a/install/bakemaster_blender_addon_2_6_0_demo.zip b/install/bakemaster_blender_addon_2_6_0_demo.zip deleted file mode 100644 index d17c382..0000000 Binary files a/install/bakemaster_blender_addon_2_6_0_demo.zip and /dev/null differ diff --git a/install/bakemaster_blender_addon_2_6_2_full_demo.zip b/install/bakemaster_blender_addon_2_6_2_full_demo.zip new file mode 100644 index 0000000..7d283c4 Binary files /dev/null and b/install/bakemaster_blender_addon_2_6_2_full_demo.zip differ diff --git a/labels.py b/labels.py index 4645b88..dc482eb 100644 --- a/labels.py +++ b/labels.py @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. @@ -68,11 +68,11 @@ class BM_Labels: PROP_ITEM_MAP_USESTT_NAME = "Affect this map by source-target settings configured in the item settings above.\nThis option won't be shown unless source-target settings are configured, or when baking smooth normals" PROP_ITEM_MAP_USEPREVIEW_DESCRIPTION = "Preview texture map in the viewport (Cycles only).\nIf current item's mesh has got no materials, a new one will be added.\nFor each item's mesh materials, custom nodes will be added to preview the map in the Rendered View.\nAfter disabling the preview, all those nodes will be removed without affecting original material(s)" - PROP_ITEM_bake_batchname_custom_Description = "Write keywords starting with $, any additional text can be added:\n\n$objectindex - Object index\n$objectname - Object name\n$containername - Container name if Object is in it\n$packname - Channel Pack name if map is in Channel Pack\n$texsetname - Texture Set chosen name type if Object is in it\n$mapindex - Map index\n$mapname - Map prefix\n$mapres - Map Resolution\n$mapbit - _32bit_ if map uses 32bit Float, else _8bit_\n$maptrans - _trans_ if map uses transparent bg\n$mapssaa - SSAA value used for the map\n$mapsamples - Number of map bake samples, max samples if Adaptive is used\n$mapdenoise - _denoised_ if map was denoised\n$mapnormal - For Normal map, write preset type\n$mapuv - Write UV Layer name used for baking map\n$engine - Write Bake Engine used for baking\n$autouv - _autouv_ if object was auto uv unwrapped\n\ntestbake1$objectname_$mapname_$mapdenoise_Final -> testbake1monsterhead_NM_denoised_Final" + PROP_ITEM_bake_batchname_custom_Description = "Write keywords starting with $, any additional text can be added:\n\n$objectindex - Object index\n$objectname - Object name\n$containername - Container name if object is in one\n$materialname/$matname - Name of the first object's material\n$packname - Channel Pack name if map is in one (Legacy, use $mapname)\n$texsetname - Texture Set naming if object is in one\n$mapindex - Map index\n$mapname - Map prefix or Channel Pack name if map is in one\n$mapres - Map Resolution\n$mapbit - Image bit depth used for baking a map\n$maptrans - _trans_ if map uses transparent bg\n$mapssaa - SSAA value used for the map\n$mapsamples - Number of map bake samples, max samples if Adaptive is used\n$mapdenoise - _denoised_ if map was denoised\n$mapnormal - For Normal map, write preset type\n$mapuv - UV Layer name used for baking a map\n$engine - Bake Engine used for baking\n$autouv - _autouv_ if object was auto uv unwrapped\n\ntestbake1$objectname_$mapname_$mapdenoise_Final -> testbake1monsterhead_NM_denoised_Final" # URLs # different documentation versions may have different pages setup - __addon_version__ = "2.6.1" + __addon_version__ = "2.6.2" URL_HELP_MAIN = "https://bakemaster-blender-addon.readthedocs.io/en/%s/" % __addon_version__ URL_HELP_OBJS = "https://bakemaster-blender-addon.readthedocs.io/en/%s/pages/start/objects.html" % __addon_version__ URL_HELP_MAPS = "https://bakemaster-blender-addon.readthedocs.io/en/%s/pages/start/maps.html" % __addon_version__ diff --git a/operator_bake.py b/operator_bake.py index 98e4d99..4b9b9ed 100644 --- a/operator_bake.py +++ b/operator_bake.py @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. diff --git a/operators.py b/operators.py index 7500fd2..1b64630 100644 --- a/operators.py +++ b/operators.py @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. @@ -1361,8 +1361,50 @@ class BM_OT_ITEM_BatchNaming_Preview(bpy.types.Operator): bl_options = {'INTERNAL'} def execute(self, context): - object = BM_Object_Get(None, context)[0] - preview = BM_ITEM_PROPS_bake_batchname_GetPreview(object, context) + sc = context.scene + g_index = sc.bm_props.global_active_index + container = BM_Object_Get(None, context)[0] + + if not sc.bm_props.global_use_name_matching: + preview = BM_ITEM_PROPS_bake_batchname_GetPreview( + container, context, container) + self.report({'INFO'}, preview) + return {'FINISHED'} + + if container.nm_is_universal_container: + bm_obj = None + for bm_obj_i in range(g_index + 1, len(sc.bm_table_of_objects), 1): + object = sc.bm_table_of_objects[bm_obj_i] + if (object.nm_item_uni_container_master_index == container.nm_master_index + and not object.nm_is_local_container): + bm_obj = sc.bm_table_of_objects[bm_obj_i] + break + + preview = BM_ITEM_PROPS_bake_batchname_GetPreview( + container, context, bm_obj) + self.report({'INFO'}, preview) + return {'FINISHED'} + + # Name Matching is used, and container is a detached object + if container.nm_item_uni_container_master_index == -1: + preview = BM_ITEM_PROPS_bake_batchname_GetPreview( + container, context, container) + self.report({'INFO'}, preview) + return {'FINISHED'} + + # Name Matching is used, and container is a child object + parent = None + for bm_obj_i in range(g_index - 1, -1, -1): + object = sc.bm_table_of_objects[bm_obj_i] + if not object.nm_is_universal_container: + continue + if (container.nm_item_uni_container_master_index == object.nm_master_index + and object.nm_is_local_container is False): + parent = object + break + + preview = BM_ITEM_PROPS_bake_batchname_GetPreview( + parent, context, container) # Container is a child object self.report({'INFO'}, preview) return {'FINISHED'} diff --git a/presets.py b/presets.py index 9f71a61..b1c67f3 100644 --- a/presets.py +++ b/presets.py @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. diff --git a/properties.py b/properties.py index f5969d6..55a9e0d 100644 --- a/properties.py +++ b/properties.py @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. @@ -647,6 +647,11 @@ class BM_SceneProps(bpy.types.PropertyGroup): precision=3, subtype='COLOR') # noqa: F405 + global_use_collapse_nodes: bpy.props.BoolProperty( + name="Collapse Nodes", + description="Collapse added shader nodes in baked materials", + default=False) + ################################################## ### MAP PROPS ### ################################################## diff --git a/shader.py b/shader.py index 4e9f19a..c09ae9b 100644 --- a/shader.py +++ b/shader.py @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. diff --git a/tools/update_license.py b/tools/update_license.py index 547526a..1faae09 100755 --- a/tools/update_license.py +++ b/tools/update_license.py @@ -2,7 +2,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. diff --git a/ui_panel.py b/ui_panel.py index d31db45..d7e5f42 100644 --- a/ui_panel.py +++ b/ui_panel.py @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. diff --git a/ui_panel_base.py b/ui_panel_base.py index 6cda436..041b7e0 100644 --- a/ui_panel_base.py +++ b/ui_panel_base.py @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. @@ -69,6 +69,16 @@ def draw(self, context): layout.prop(bm_props, 'global_cage_color_solid') layout.prop(bm_props, 'global_cage_color_wire') + if bpy.app.version >= (2, 90, 0): + col = self.layout.column(align=True, heading="Baked Materials") + col.prop(bm_props, 'global_use_collapse_nodes') + else: + layout = self.layout.column(align=True) + split = layout.split(factor=0.4) + split.row() + split.label(text="Baked Materials") + layout.prop(bm_props, 'global_use_collapse_nodes') + class BM_ALEP_UL_Objects_Item(bpy.types.UIList): def draw_item(self, context, layout, data, item, active_data, active_propname, index): @@ -541,7 +551,7 @@ def invoke(self, context, event): class BM_PT_MainBase(bpy.types.Panel): - bl_label = "BakeMaster v2.6.1" + bl_label = "BakeMaster v2.6.2" bl_idname = 'BM_PT_Main' def draw(self, context): @@ -773,9 +783,16 @@ def draw(self, context): d_col.prop(object, "decal_rotation") - col = d_col.column(align=True, heading="Flip") - col.prop(object, 'decal_use_flip_vertical') - col.prop(object, 'decal_use_flip_horizontal') + if bpy.app.version >= (2, 90, 0): + col = d_col.column(align=True, heading="Flip") + col.prop(object, 'decal_use_flip_vertical') + col.prop(object, 'decal_use_flip_horizontal') + else: + col = d_col.column(align=True) + col.prop(object, 'decal_use_flip_vertical', + text="Flip Vertically") + col.prop(object, 'decal_use_flip_horizontal', + text="Flip Horizontally") col = d_col.column() col.prop(object, 'decal_use_adapt_res') diff --git a/utils.py b/utils.py index d31f376..9470652 100644 --- a/utils.py +++ b/utils.py @@ -1,7 +1,7 @@ # BEGIN LICENSE & COPYRIGHT BLOCK. # # Copyright (C) 2022-2024 Kiril Strezikozin -# BakeMaster Blender Add-on (version 2.6.1) +# BakeMaster Blender Add-on (version 2.6.2) # # This file is a part of BakeMaster Blender Add-on, a plugin for texture # baking in open-source Blender 3d modelling software. @@ -1799,22 +1799,29 @@ def BM_SCENE_PROPS_cm_linear_color_space_Items(self, context): def BM_ITEM_PROPS_bake_batchname_GetPreview(container, context, object=None, map=None, global_active_index=None, decal_texset_tag=""): - # funcs for data get - def get_objectname(container): - if not any([container.nm_is_universal_container, container.nm_is_local_container]): - return container.global_object_name - for obj in context.scene.bm_table_of_objects: - if obj.nm_item_uni_container_master_index == container.nm_master_index and obj.nm_is_local_container is False: - return obj.global_object_name + def get_objectname(object): + if object is None: + return "" + return object.global_object_name def get_containername(container): - if context.scene.bm_props.global_use_name_matching is False: - return None + if (context.scene.bm_props.global_use_name_matching is False + or container is None): + return "" if container.nm_is_universal_container: return container.nm_container_name - for obj in context.scene.bm_table_of_objects: - if container.nm_item_uni_container_master_index == obj.nm_master_index and obj.nm_is_universal_container: - return obj.nm_container_name + else: + return "" + + def get_materialname(source_object): + if source_object is None: + return "" + mats = source_object.data.materials + for mat in mats: + if mat is None: + continue + return mat.name + return "" def get_packname(container, map): for chnlpack in container.chnlp_channelpacking_table: @@ -1831,6 +1838,12 @@ def get_packname(container, map): return chnlpack.global_channelpack_name return None + def get_mapname(container, map): + packname = get_packname(container, map) + if packname is None: + return getattr(map, 'map_{}_prefix'.format(map.global_map_type)) + return packname + def get_texsetname(container): if not any([container.nm_is_universal_container, container.nm_is_local_container]): @@ -1889,14 +1902,16 @@ def get_mapnormal(map_pass): if container is None: container = BM_Object_Get(None, context)[0] - if len(container.global_maps) == 0: - # container.bake_batchname_preview = "*Object has no Maps*" - return "*Object has no Maps*" - map = container.global_maps[container.global_maps_active_index] global_active_index = context.scene.bm_props.global_active_index + if len(container.global_maps) == 0: + return "*Object has no Maps*" + if object is None: - object = container + source_object = None + else: + source_object = context.scene.objects.get(object.global_object_name) + if map is None: map = container.global_maps[container.global_maps_active_index] @@ -1913,10 +1928,12 @@ def get_mapnormal(map_pass): "$objectindex": global_active_index, "$objectname": get_objectname(object), "$containername": get_containername(container), + "$materialname": get_materialname(source_object), + "$matname": get_materialname(source_object), "$packname": get_packname(container, map), "$texsetname": get_texsetname(container), "$mapindex": map.global_map_index, - "$mapname": getattr(map, 'map_{}_prefix'.format(map.global_map_type)), + "$mapname": get_mapname(container, map), "$mapres": get_mapres(out_container), "$mapbit": f"{out_container.out_bit_depth}bit", "$maptrans": "transbg" if out_container.out_use_transbg else "",