Compare commits
No commits in common. "8105b110f2dfc1b6f087c51c1f2bca3ee9afc180" and "94d5c934c63779cabbc8656005c8b508faa3063a" have entirely different histories.
8105b110f2
...
94d5c934c6
@ -1,7 +1,6 @@
|
|||||||
import bpy, bmesh, mathutils, math
|
import bpy, bmesh, mathutils, math
|
||||||
import typing
|
import typing
|
||||||
from . import UTIL_functions, UTIL_naming_convension
|
from . import UTIL_functions, UTIL_naming_convension
|
||||||
from . import PROP_bme_material
|
|
||||||
|
|
||||||
## Const Value Hint:
|
## Const Value Hint:
|
||||||
# Default Rail Radius: 0.35 (in measure)
|
# Default Rail Radius: 0.35 (in measure)
|
||||||
@ -163,9 +162,8 @@ class SharedScrewRailInputProperty():
|
|||||||
|
|
||||||
rail_screw_radius: bpy.props.FloatProperty(
|
rail_screw_radius: bpy.props.FloatProperty(
|
||||||
name = "Radius",
|
name = "Radius",
|
||||||
description = "The screw radius.",
|
description = "The screw radius. Minus radius will flip the built screw.",
|
||||||
default = 5,
|
default = 5,
|
||||||
min = 0,
|
|
||||||
unit = 'LENGTH'
|
unit = 'LENGTH'
|
||||||
) # type: ignore
|
) # type: ignore
|
||||||
|
|
||||||
@ -443,10 +441,7 @@ class BBP_OT_add_side_spiral_rail(SharedExtraTransform, SharedRailSectionInputPr
|
|||||||
|
|
||||||
#region BMesh Operations Helper
|
#region BMesh Operations Helper
|
||||||
|
|
||||||
def _bmesh_extrude(
|
def _bmesh_extrude(bm: bmesh.types.BMesh, start_edges: list[bmesh.types.BMEdge], direction: mathutils.Vector) -> list[bmesh.types.BMEdge]:
|
||||||
bm: bmesh.types.BMesh,
|
|
||||||
start_edges: list[bmesh.types.BMEdge],
|
|
||||||
direction: mathutils.Vector) -> list[bmesh.types.BMEdge]:
|
|
||||||
# extrude
|
# extrude
|
||||||
ret: dict[str, typing.Any] = bmesh.ops.extrude_edge_only(
|
ret: dict[str, typing.Any] = bmesh.ops.extrude_edge_only(
|
||||||
bm,
|
bm,
|
||||||
@ -490,7 +485,7 @@ def _bmesh_screw(
|
|||||||
space = mathutils.Matrix.Identity(4),
|
space = mathutils.Matrix.Identity(4),
|
||||||
steps = steps * iterations,
|
steps = steps * iterations,
|
||||||
use_merge = False,
|
use_merge = False,
|
||||||
use_normal_flip = True, # NOTE: flip normal according to test result.
|
use_normal_flip = True, # NOTE: flip nml according to real test result
|
||||||
use_duplicate = False
|
use_duplicate = False
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -544,12 +539,6 @@ def _rail_creator_wrapper(fct_poly_cret: typing.Callable[[bmesh.types.BMesh], No
|
|||||||
# setup smooth for mesh
|
# setup smooth for mesh
|
||||||
mesh.shade_smooth()
|
mesh.shade_smooth()
|
||||||
|
|
||||||
# setup default material
|
|
||||||
with PROP_bme_material.BMEMaterialsHelper(bpy.context.scene) as bmemtl:
|
|
||||||
mesh.materials.clear()
|
|
||||||
mesh.materials.append(bmemtl.get_material('Rail'))
|
|
||||||
mesh.validate_material_indices()
|
|
||||||
|
|
||||||
# create object and assoc with it
|
# create object and assoc with it
|
||||||
# create info first
|
# create info first
|
||||||
rail_info: UTIL_naming_convension.BallanceObjectInfo = UTIL_naming_convension.BallanceObjectInfo.create_from_others(
|
rail_info: UTIL_naming_convension.BallanceObjectInfo = UTIL_naming_convension.BallanceObjectInfo.create_from_others(
|
||||||
@ -673,9 +662,7 @@ def _create_straight_rail(
|
|||||||
start_edges: list[bmesh.types.BMEdge] = bm.edges[:]
|
start_edges: list[bmesh.types.BMEdge] = bm.edges[:]
|
||||||
# extrude and get end edges
|
# extrude and get end edges
|
||||||
end_edges: list[bmesh.types.BMEdge] = _bmesh_extrude(
|
end_edges: list[bmesh.types.BMEdge] = _bmesh_extrude(
|
||||||
bm,
|
bm, start_edges, mathutils.Vector((0, rail_length, 0))
|
||||||
start_edges,
|
|
||||||
mathutils.Vector((0, rail_length, 0))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# smooth geometry
|
# smooth geometry
|
||||||
@ -706,9 +693,7 @@ def _create_transition_rail(
|
|||||||
start_edges: list[bmesh.types.BMEdge] = bm.edges[:]
|
start_edges: list[bmesh.types.BMEdge] = bm.edges[:]
|
||||||
# extrude and get end edges
|
# extrude and get end edges
|
||||||
end_edges: list[bmesh.types.BMEdge] = _bmesh_extrude(
|
end_edges: list[bmesh.types.BMEdge] = _bmesh_extrude(
|
||||||
bm,
|
bm, start_edges, mathutils.Vector((0, rail_length, 0))
|
||||||
start_edges,
|
|
||||||
mathutils.Vector((0, rail_length, 0))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# smooth geometry
|
# smooth geometry
|
||||||
|
@ -220,7 +220,7 @@ def _export_virtools_light(
|
|||||||
light_crets: tuple[_TLightPair, ...]
|
light_crets: tuple[_TLightPair, ...]
|
||||||
) -> None:
|
) -> None:
|
||||||
# start saving
|
# start saving
|
||||||
progress.enter_substeps(len(light_crets), "Saving Lights")
|
progress.enter_substeps(0, "Saving Lights")
|
||||||
|
|
||||||
for obj3d, light, vtlight in light_crets:
|
for obj3d, light, vtlight in light_crets:
|
||||||
# set name
|
# set name
|
||||||
|
@ -63,11 +63,6 @@ _g_BMEMaterialPresets: dict[str, _BMEMaterialPreset] = {
|
|||||||
'Ball_Wood.bmp',
|
'Ball_Wood.bmp',
|
||||||
PROP_virtools_material.get_virtools_material_preset(PROP_virtools_material.MaterialPresetType.TraforWoodStone).mData
|
PROP_virtools_material.get_virtools_material_preset(PROP_virtools_material.MaterialPresetType.TraforWoodStone).mData
|
||||||
),
|
),
|
||||||
|
|
||||||
'Rail': _BMEMaterialPreset(
|
|
||||||
'Rail_Environment.bmp',
|
|
||||||
PROP_virtools_material.get_virtools_material_preset(PROP_virtools_material.MaterialPresetType.Rail).mData
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user