diff --git a/README.md b/README.md index 5421f1b..8f66427 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/docs/panel.png b/docs/panel.png index 170b493..d4140ad 100644 Binary files a/docs/panel.png and b/docs/panel.png differ diff --git a/quickbake/op.py b/quickbake/op.py index 8489fc9..cee516f 100644 --- a/quickbake/op.py +++ b/quickbake/op.py @@ -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 diff --git a/quickbake/panel.py b/quickbake/panel.py index aef69ca..a5e8e2e 100644 --- a/quickbake/panel.py +++ b/quickbake/panel.py @@ -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") diff --git a/quickbake/properties.py b/quickbake/properties.py index 2abe364..32d1c7a 100644 --- a/quickbake/properties.py +++ b/quickbake/properties.py @@ -8,7 +8,7 @@ class MaterialMode(StrEnum): IMAGES = "IMAGES" CREATE = "CREATE" ASSIGN = "ASSIGN" - COPY = "COPY" + DUPLICATE = "DUPLICATE" class QuickBakeToolPropertyGroup(bpy.types.PropertyGroup): @@ -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(