Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ranjian0 committed Dec 17, 2023
2 parents 4a5950e + 0546d45 commit da82215
Show file tree
Hide file tree
Showing 67 changed files with 2,657 additions and 4,550 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release Addon Zip

on:
push:
tags:
- "v*.*.*"

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.12'
- name: Create release zip
run: |
pip install pdm
pdm run build
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: Building Tools ${{ github.ref_name }}
files: building_tools_${{ github.ref_name }}.zip
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,7 @@ dmypy.json
.idea
/docs/_site
/docs/Gemfile.lock

.pdm.toml
.pdm-python
.pdm-build/
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ and `Building Tools` was born.

## Installation

1. Download add-on (zipped) from this [link](https://github.com/ranjian0/building_tools/releases/download/v1.0.10/building_tools-v1.0.10.zip).
1. Download add-on (zipped) from this [link](https://github.com/ranjian0/building_tools/releases/download/v1.0.10/building_tools-v1.0.11.zip).
2. In blender, go to : Edit -> Preferences -> Add-ons -> Install.
3. Select the downloaded file and you're good to go.

Expand All @@ -47,9 +47,9 @@ and `Building Tools` was born.

## Status

`Version` : `v1.0.10`
`Version` : `v1.0.11`

**Blender 3.0 Compatible**
**Blender 4.0 Compatible**

## Inspiration

Expand Down
114 changes: 36 additions & 78 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
bl_info = {
"name": "Building Tools",
"author": "Ian Karanja (ranjian0), Lucky Kadam (luckykadam), Marcus (MCrafterzz)",
"version": (1, 0, 10),
"blender": (2, 80, 0),
"version": (1, 0, 11),
"blender": (3, 3, 0),
"location": "View3D > Toolshelf > Building Tools",
"description": "Building Creation Tools",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"doc_url": "https://github.com/ranjian0/building_tools/wiki",
"category": "Mesh",
}

Expand Down Expand Up @@ -91,101 +90,60 @@ def draw(self, context):
layout = self.layout

ob = context.object
facemap = ob.face_maps.active
active_index = ob.bt_materials_active_index

rows = 2
if facemap:
if active_index > 0:
rows = 4

if not len(ob.face_maps):
if not len(ob.bt_materials):
return

layout.label(text="Face Maps")
layout.label(text="Groups")

row = layout.row()
args = ob, "face_maps", ob.face_maps, "active_index"
row.template_list("BTOOLS_UL_fmaps", "", *args, rows=rows)
row.template_list("BTOOLS_UL_materials", "", ob, "bt_materials", ob, "bt_materials_active_index", rows=rows)

col = row.column(align=True)
col.operator("object.face_map_add", icon="ADD", text="")
col.operator("object.face_map_remove", icon="REMOVE", text="")
col.operator("btools.material_group_add", icon="ADD", text="")
col.operator("btools.material_group_remove", icon="REMOVE", text="")
col.separator()
col.operator("btools.face_map_clear", icon="TRASH", text="")
col.operator("btools.materials_clear", icon="TRASH", text="")

if ob.face_maps and (ob.mode == "EDIT" and ob.type == "MESH"):
if ob.bt_materials and (ob.mode == "EDIT" and ob.type == "MESH"):
row = layout.row()

sub = row.row(align=True)
sub.operator("object.face_map_assign", text="Assign")
sub.operator("object.face_map_remove_from", text="Remove")
sub.operator("btools.material_group_assign", text="Assign")
sub.operator("btools.material_group_remove_from", text="Remove")

sub = row.row(align=True)
sub.operator("object.face_map_select", text="Select")
sub.operator("object.face_map_deselect", text="Deselect")

if ob.face_maps:
face_map_index = ob.face_maps.active_index
face_map_material = ob.facemap_materials[face_map_index]

layout.label(text="UV Mapping")

col = layout.column()
row = col.row(align=True)
row.alignment = "LEFT"
row.prop(face_map_material, "auto_map", text="Auto")
row.prop(face_map_material, "uv_mapping_method", text="")

layout.label(text="Material")
sp = layout.split(factor=0.8, align=True)
sp.operator("btools.create_facemap_material")
sp.operator("btools.remove_facemap_material", icon="PANEL_CLOSE", text="")
layout.template_ID_preview(face_map_material, "material", hide_buttons=True)


class BTOOLS_PT_PrefPanel(bpy.types.AddonPreferences):
bl_idname = __name__

# addon updater preferences
auto_check_update : bpy.props.BoolProperty(
name="Auto-check for Update",
description="If enabled, auto-check for updates using an interval",
default=False,
)

updater_intrval_months : bpy.props.IntProperty(
name='Months',
description="Number of months between checking for updates",
default=0,
min=0
)
updater_intrval_days : bpy.props.IntProperty(
name='Days',
description="Number of days between checking for updates",
default=7,
min=0,
)
updater_intrval_hours : bpy.props.IntProperty(
name='Hours',
description="Number of hours between checking for updates",
default=0,
min=0,
max=23
)
updater_intrval_minutes : bpy.props.IntProperty(
name='Minutes',
description="Number of minutes between checking for updates",
default=0,
min=0,
max=59
)
sub.operator("btools.material_group_select", text="Select")
sub.operator("btools.material_group_deselect", text="Deselect")

if ob.bt_materials:
mat_index = ob.bt_materials_active_index
if mat_index < len(ob.bt_materials):
face_map_material = ob.bt_materials[mat_index]

def draw(self, context):
from . import addon_updater_ops
addon_updater_ops.update_settings_ui(self, context)
layout.label(text="UV Mapping")

col = layout.column()
row = col.row(align=True)
row.alignment = "LEFT"
row.prop(face_map_material, "auto_map", text="Auto")
row.prop(face_map_material, "uv_mapping_method", text="")

layout.label(text="Material")
sp = layout.split(factor=0.8, align=True)
sp.operator("btools.create_material")
sp.operator("btools.remove_material", icon="PANEL_CLOSE", text="")
layout.template_ID_preview(face_map_material, "material", hide_buttons=True)
else:
layout.label(text=("This matgroup was corrupted by a destructive operation on the object."), icon="ERROR")


classes = (BTOOLS_PT_building_tools, BTOOLS_PT_material_tools, BTOOLS_PT_PrefPanel)
classes = (BTOOLS_PT_building_tools, BTOOLS_PT_material_tools)

register_ui, unregister_ui = bpy.utils.register_classes_factory(classes)

Expand Down
Loading

0 comments on commit da82215

Please sign in to comment.