Skip to content
Merged
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
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,19 @@ Download this repo as a zip file and install through the Blender addons.

### Inputs

| Field | Description |
| --------------- | ------------------------------------------------------ |
| Name | Name used for baked images and material |
| Size | Bake image size in pixels |
| Assign Material | Assign material with baked images to object after bake |
| Save Images | Save images to external directory |
| Layers | Enable baking of different layers, one image per layer |
| Field | Description |
| ----------- | ------------------------------------------------------ |
| Name | Name used for baked images and material |
| Mode | What to do with images after bake |
| Size | Bake image size in pixels |
| Save Images | Save images to external directory |
| Layers | Enable baking of different layers, one image per layer |

Mode has the following options

| Mode | Description |
| --------------- | ---------------------------------------------------- |
| Image Only | Only generate images |
| Create Material | Create a new material with the baked images |
| Assign Material | Assign the material to active object |
| Copy Object | Duplicate the object before assigning baked material |
Binary file modified docs/panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion quickbake/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def execute(self, context: bpy.types.Context):
mat = self.create_material(props, uv_layer, passes, images)

# Duplicate object and assign material to new
if props.mat_mode == MaterialMode.COPY:
if props.mat_mode == MaterialMode.DUPLICATE:
bpy.ops.object.duplicate()
obj.hide_set(True)
# Get new object
Expand Down
8 changes: 4 additions & 4 deletions quickbake/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ def draw(self, context):

props = scene.QuickBakeToolPropertyGroup # type: ignore

# This is the bake button
layout.operator(RENDER_OT_bake.bl_idname)

layout.prop(props, "bake_name")
layout.prop(props, "bake_size")
layout.prop(props, "mat_mode")
layout.prop(props, "bake_size")
layout.prop(props, "save_img")

row = layout.row()
row.enabled = props.save_img
row.prop(props, "save_path", text="")

# This is the bake button
layout.operator(RENDER_OT_bake.bl_idname)

layout.separator()
layout.label(text="Layers")

Expand Down
12 changes: 6 additions & 6 deletions quickbake/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class MaterialMode(StrEnum):
IMAGES = "IMAGES"
CREATE = "CREATE"
ASSIGN = "ASSIGN"
COPY = "COPY"
DUPLICATE = "DUPLICATE"


class QuickBakeToolPropertyGroup(bpy.types.PropertyGroup):
Expand Down Expand Up @@ -44,16 +44,16 @@ class QuickBakeToolPropertyGroup(bpy.types.PropertyGroup):
),
(
MaterialMode.ASSIGN,
"Assign material",
"Assign Material",
"Assign the material to active object",
),
(
MaterialMode.COPY,
"Copy Object",
"Make a copy of the object with baked material assigned",
MaterialMode.DUPLICATE,
"Duplicate Object",
"Duplicate the object before assigning baked material",
),
],
default="ASSIGN",
default=MaterialMode.ASSIGN,
)

save_img: bpy.props.BoolProperty(
Expand Down