Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Blender-BakeLab2
![Thumbnail](bakelab_thumbnail_text_logo_small.jpg)
BakeLab - A blender addon for baking images.<br>
Compatible with Blender 2.81 or higher.<br>
For blender version 2.79 go to [here](https://github.com/Shahzod114/Bakelab-Blender-addon)
Compatible with Blender 4.0.0/5.0.0 or higher.<br>
For Blender version 2.79, go to [here](https://github.com/Shahzod114/Bakelab-Blender-addon)

Main Features:
* Automatically create images, setup materials, bake objects and save/pack images in one click;
* Automatically create images, setup materials, bake objects, and save/pack images in one click;
* Automatically generating materials;
* Anti-Aliased baking;
* Baking cycles displacement to real geometry;
* Bake any PBR attributes of your material by its name (Metallic, Roughness, Specular and etc);
* Bake any PBR attributes of your material by its name (Metallic, Roughness, Specular etc.);
* Adaptive image size by object's surface size;
* Unwrap and Bake Multiple Objects into one image;

Expand Down
41 changes: 11 additions & 30 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

bl_info = {
"name" : "BakeLab",
"author" : "Shahzod Boyxonov (specoolar@gmail.com)",
"description" : "Bake textures easily",
"blender" : (2, 81, 0),
"version" : (2, 0, 1),
"blender" : (4, 0, 0),
"version" : (2, 0, 2),
"location" : "View3D > Properties > BakeLab",
"category" : "Baking"
}
Expand All @@ -40,8 +27,8 @@
import bpy

from bpy.types import (
Operator,
PropertyGroup,
Operator,
PropertyGroup,
Panel
)
from bpy.props import (
Expand All @@ -61,10 +48,6 @@ def updateAdaptiveImageMinSize(self, context):
def updateAdaptiveImageMaxSize(self, context):
self.image_max_size = max(self.image_min_size, self.image_max_size)

def updateSavePath(self, context):
if bpy.data.is_saved:
self.save_path = bpy.path.abspath(self.save_path)

class BakeLabProperties(PropertyGroup):
bake_state: EnumProperty(
items = (
Expand Down Expand Up @@ -122,7 +105,7 @@ class BakeLabProperties(PropertyGroup):
update=updateAdaptiveImageMinSize
)
round_adaptive_image : BoolProperty(
name = 'Round to power of two',
name = 'Round to power of two',
default = True
)
anti_alias : IntProperty(
Expand Down Expand Up @@ -162,7 +145,7 @@ class BakeLabProperties(PropertyGroup):
name="Create folder",
description="Automatically creates a folder named after the object(s)",
default = True
)
)
folder_name : StringProperty(
name = 'Folder name',
description = 'Name of the folder',
Expand All @@ -172,12 +155,11 @@ class BakeLabProperties(PropertyGroup):
default=expanduser("~"),
name="Folder",
subtype="DIR_PATH",
update=updateSavePath
)
show_bake_settings : BoolProperty(name = '', default = False)
show_map_settings : BoolProperty(name = '', default = False)
show_file_settings : BoolProperty(name = '', default = False)

apply_only_selected : BoolProperty(
name = 'Apply only to Selected',
description = 'Apply only to selected objects',
Expand All @@ -188,7 +170,6 @@ class BakeLabProperties(PropertyGroup):
description = 'Make data single user',
default = True
)
# Display
baking_obj_count : IntProperty(
name = 'Baking object count',
default = 0
Expand Down Expand Up @@ -224,7 +205,7 @@ class BakeLabProperties(PropertyGroup):

classes = (
BakeLabProperties,

bakelab_bake.Baker,
bakelab_uv.Unwrapper,
bakelab_uv.ClearUV,
Expand All @@ -246,7 +227,7 @@ class BakeLabProperties(PropertyGroup):
def register():
for cls in classes:
bpy.utils.register_class(cls)

bpy.types.Scene.BakeLabProps = PointerProperty(type = BakeLabProperties)
bpy.types.Scene.BakeLabMaps = CollectionProperty(type = bakelab_map.BakeLabMap)
bpy.types.Scene.BakeLab_Data = CollectionProperty(type = bakelab_baked_data.BakeLab_BakedData)
Expand All @@ -255,11 +236,11 @@ def register():
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)

del bpy.types.Scene.BakeLabProps
del bpy.types.Scene.BakeLabMaps
del bpy.types.Scene.BakeLab_Data
del bpy.types.Scene.BakeLabMapIndex

if __name__ == "__main__":
register()
register()
Loading