Skip to content

Commit

Permalink
Increased default branch get to 100 limit, and added as mesh conversi… (
Browse files Browse the repository at this point in the history
#181)

* Increased default branch get to 100 limit, and added as mesh conversion for text + surfaces + metaball

* poetry lock
  • Loading branch information
JR-Morgan authored Feb 7, 2024
1 parent 86bc2dc commit f036109
Show file tree
Hide file tree
Showing 4 changed files with 520 additions and 514 deletions.
10 changes: 9 additions & 1 deletion bpy_speckle/convert/to_speckle.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
Units: str = "m" # The desired final units to send
UnitsScale: float = 1 # The scale factor conversions need to apply to position data to get to the desired units

CAN_CONVERT_TO_SPECKLE = ("MESH", "CURVE", "EMPTY", "CAMERA")
CAN_CONVERT_TO_SPECKLE = ("MESH", "CURVE", "EMPTY", "CAMERA", "FONT", "SURFACE", "META")


def convert_to_speckle(raw_blender_object: Object, units_scale: float, units: str, depsgraph: Optional[Depsgraph]) -> Base:
Expand Down Expand Up @@ -69,6 +69,8 @@ def convert_to_speckle(raw_blender_object: Object, units_scale: float, units: st
converted = empty_to_speckle(blender_object)
elif blender_type == "CAMERA":
converted = camera_to_speckle_view(blender_object, cast(NCamera, blender_object.data))
elif blender_type == "FONT" or "SURFACE" or "META":
converted = anything_to_speckle_mesh(blender_object)
if not converted:
raise Exception("Conversion returned None")

Expand Down Expand Up @@ -370,6 +372,12 @@ def curve_to_speckle_geometry(blender_object: Object, data: bpy.types.Curve) ->

return (meshes, curves)

def anything_to_speckle_mesh(blender_object: Object) -> Base:

mesh = mesh_to_speckle(blender_object, blender_object.to_mesh())
blender_object.to_mesh_clear()
return mesh

@deprecated
def ngons_to_speckle_polylines(blender_object: Object, data: bpy.types.Mesh) -> Optional[List[Polyline]]:
UNITS = "m" if bpy.context.scene.unit_settings.system == "METRIC" else "ft"
Expand Down
2 changes: 1 addition & 1 deletion bpy_speckle/operators/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class LoadUserStreams(bpy.types.Operator):
bl_description = "(Re)load all available user streams"

stream_limit: int = 20
branch_limit: int = 20
branch_limit: int = 100

def execute(self, context):
try:
Expand Down
Loading

0 comments on commit f036109

Please sign in to comment.