kopia lustrzana https://github.com/vilemduha/blendercam
58 wiersze
1.5 KiB
Python
58 wiersze
1.5 KiB
Python
"""BlenderCAM 'chain.py'
|
|
|
|
All properties of a CAM Chain (a series of Operations), and the Chain's Operation reference.
|
|
"""
|
|
|
|
from bpy.props import (
|
|
BoolProperty,
|
|
CollectionProperty,
|
|
IntProperty,
|
|
StringProperty,
|
|
)
|
|
from bpy.types import PropertyGroup
|
|
|
|
|
|
# this type is defined just to hold reference to operations for chains
|
|
class opReference(PropertyGroup):
|
|
name: StringProperty(
|
|
name="Operation Name",
|
|
default="Operation",
|
|
)
|
|
computing = False # for UiList display
|
|
|
|
|
|
# chain is just a set of operations which get connected on export into 1 file.
|
|
class camChain(PropertyGroup):
|
|
index: IntProperty(
|
|
name="Index",
|
|
description="Index in the hard-defined camChains",
|
|
default=-1,
|
|
)
|
|
active_operation: IntProperty(
|
|
name="Active Operation",
|
|
description="Active operation in chain",
|
|
default=-1,
|
|
)
|
|
name: StringProperty(
|
|
name="Chain Name",
|
|
default="Chain",
|
|
)
|
|
filename: StringProperty(
|
|
name="File Name",
|
|
default="Chain",
|
|
) # filename of
|
|
valid: BoolProperty(
|
|
name="Valid",
|
|
description="True if whole chain is ok for calculation",
|
|
default=True,
|
|
)
|
|
computing: BoolProperty(
|
|
name="Computing Right Now",
|
|
description="",
|
|
default=False,
|
|
)
|
|
# this is to hold just operation names.
|
|
operations: CollectionProperty(
|
|
type=opReference,
|
|
)
|