improves build to also include the version into the bl_info
This commit is contained in:
parent
6a89168707
commit
bc6734a349
3 changed files with 25 additions and 11 deletions
|
|
@ -1 +1 @@
|
|||
1.0.0+build.5
|
||||
1.0.0+build.18
|
||||
|
|
@ -10,6 +10,7 @@ PROJECT_NAME = "Bake ID Mask"
|
|||
CURRENT_PATH = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
SOURCE_PATH = os.path.join(CURRENT_PATH, "../src")
|
||||
INIT_FILE_PATH = os.path.join(SOURCE_PATH, "__init__.py")
|
||||
TARGET_PATH = os.path.join(CURRENT_PATH, '../dist')
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
@ -22,6 +23,14 @@ if __name__ == "__main__":
|
|||
versioning.save_version(nextVersion)
|
||||
|
||||
filename = os.path.join(TARGET_PATH, ZIP_FILE_NAME.format(version=nextVersion.__str__()))
|
||||
original_init_content = ''
|
||||
with open(INIT_FILE_PATH, 'r') as f:
|
||||
original_init_content = f.read()
|
||||
|
||||
version_insert = original_init_content.replace('# !VERSION', '"version": ({}, {}, {}),'.format(nextVersion.major, nextVersion.minor, nextVersion.patch))
|
||||
with open(INIT_FILE_PATH, 'w') as f:
|
||||
f.write(version_insert)
|
||||
|
||||
with zipfile.ZipFile(filename, 'w', zipfile.ZIP_DEFLATED) as zip:
|
||||
for (root, dirs, files) in os.walk(SOURCE_PATH):
|
||||
if '__pycache__' in dirs:
|
||||
|
|
@ -37,4 +46,7 @@ if __name__ == "__main__":
|
|||
zip.write(
|
||||
os.path.join(root, file),
|
||||
os.path.join(PROJECT_NAME, relativePath)
|
||||
)
|
||||
)
|
||||
|
||||
with open(INIT_FILE_PATH, 'w') as f:
|
||||
f.write(original_init_content)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,12 @@
|
|||
bl_info = {
|
||||
"name": "Bake ID Mask",
|
||||
"author": "iedSoftworks",
|
||||
"description": "",
|
||||
# !VERSION
|
||||
"blender": (2, 80, 0),
|
||||
"category": "Object"
|
||||
}
|
||||
|
||||
import bpy
|
||||
|
||||
from . panels.panel_options import BakeToIDOptionsPanel
|
||||
|
|
@ -7,14 +16,6 @@ from . panels.panel import BakeToIDMapPanel
|
|||
from . panels.panel_info import BakeToIDInfoPanel
|
||||
from . properties.bake_to_id import BakeToIDProperties
|
||||
|
||||
bl_info = {
|
||||
"name": "Bake ID Mask",
|
||||
"author": "iedSoftworks",
|
||||
"description": "",
|
||||
"blender": (2, 80, 0),
|
||||
"category": "Object"
|
||||
}
|
||||
|
||||
classes = (
|
||||
BakeToIDMapOperator,
|
||||
BakeToIDMapPanel,
|
||||
|
|
@ -24,13 +25,14 @@ classes = (
|
|||
BakeToIDProperties,
|
||||
)
|
||||
|
||||
def register():
|
||||
|
||||
def register():
|
||||
for cls in classes:
|
||||
bpy.utils.register_class(cls)
|
||||
|
||||
setattr(bpy.types.Scene, 'bake_to_id_props', bpy.props.PointerProperty(type=BakeToIDProperties))
|
||||
|
||||
|
||||
def unregister():
|
||||
for cls in reversed(classes):
|
||||
bpy.utils.unregister_class(cls)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue