Skip to content

Commit 59cbe21

Browse files
committed
change autosave and export options
1 parent c9e2248 commit 59cbe21

18 files changed

+54
-33
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
* Added `FoFinSession.find_cablemesh`.
13+
1214
### Changed
1315

16+
* Changed value of `FoFinSession.settings.autosave` to `True`.
17+
1418
### Removed
1519

20+
* Removed option to export `Scene` (only `CableMesh`).
21+
1622

1723
## [0.15.2] 2025-03-11
1824

commands/FF_anchors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def RunCommand():
1616
# Load stuff from session
1717
# =============================================================================
1818

19-
meshobj: RhinoCableMeshObject = session.scene.get_node_by_name(name="CableMesh")
19+
meshobj: RhinoCableMeshObject = session.find_cablemesh()
2020
if not meshobj:
2121
return
2222

commands/FF_anchors_constraints.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def RunCommand():
2121
# Load stuff from session
2222
# =============================================================================
2323

24-
meshobj: RhinoCableMeshObject = session.scene.find_by_name(name="CableMesh")
24+
meshobj: RhinoCableMeshObject = session.find_cablemesh()
2525
if not meshobj:
2626
return
2727

@@ -88,13 +88,13 @@ def RunCommand():
8888
if not constraint:
8989
curve = compas_rhino.conversions.curveobject_to_compas(robj)
9090
constraint = Constraint(curve)
91-
sceneobject = session.scene.add(constraint, color=Color.cyan())
91+
sceneobject = session.scene.add(constraint, color=Color.cyan()) # type: ignore
9292
sceneobject.draw()
9393

9494
robj = compas_rhino.objects.find_object(sceneobject.guids[0])
9595
robj.UserDictionary["constraint.guid"] = str(constraint.guid)
9696

97-
meshobj.mesh.constraints[str(constraint.guid)] = constraint
97+
meshobj.mesh.constraints[str(constraint.guid)] = constraint # type: ignore
9898
rs.HideObject(guid)
9999

100100
# -----------------------------------

commands/FF_anchors_move.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def RunCommand():
1616
# Load stuff from session
1717
# =============================================================================
1818

19-
meshobj: RhinoCableMeshObject = session.scene.find_by_name(name="CableMesh")
19+
meshobj: RhinoCableMeshObject = session.find_cablemesh()
2020
if not meshobj:
2121
return
2222

commands/FF_anchors_update.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def RunCommand():
1515
# Load stuff from session
1616
# =============================================================================
1717

18-
meshobj: RhinoCableMeshObject = session.scene.get_node_by_name(name="CableMesh")
18+
meshobj: RhinoCableMeshObject = session.find_cablemesh()
1919
if not meshobj:
2020
return
2121

commands/FF_edges_attrs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def RunCommand():
1616
# Load stuff from session
1717
# =============================================================================
1818

19-
meshobj: RhinoCableMeshObject = session.scene.get_node_by_name(name="CableMesh")
19+
meshobj: RhinoCableMeshObject = session.find_cablemesh()
2020
if not meshobj:
2121
return
2222

commands/FF_edges_delete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def RunCommand():
1616
# Load stuff from session
1717
# =============================================================================
1818

19-
meshobj: RhinoCableMeshObject = session.scene.get_node_by_name(name="CableMesh")
19+
meshobj: RhinoCableMeshObject = session.find_cablemesh()
2020
if not meshobj:
2121
return
2222

commands/FF_edges_q.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def RunCommand():
2121
# Load stuff from session
2222
# =============================================================================
2323

24-
meshobj: RhinoCableMeshObject = session.scene.get_node_by_name(name="CableMesh")
24+
meshobj: RhinoCableMeshObject = session.find_cablemesh()
2525
if not meshobj:
2626
return
2727

commands/FF_pattern.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def RunCommand():
2424
# Get stuff from session
2525
# =============================================================================
2626

27-
meshobj: RhinoCableMeshObject = session.scene.find_by_name(name="CableMesh")
27+
meshobj: RhinoCableMeshObject = session.find_cablemesh()
2828

2929
# =============================================================================
3030
# Confirmation
@@ -43,7 +43,9 @@ def RunCommand():
4343
# Make a CableMesh "Pattern"
4444
# =============================================================================
4545

46-
option = rs.GetString(message="CableMesh From", strings=["RhinoBox", "RhinoCylinder", "RhinoMesh", "RhinoSurface", "MeshGrid", "JSON"])
46+
mesh: CableMesh
47+
48+
option = rs.GetString(message="CableMesh From", strings=["RhinoBox", "RhinoCylinder", "RhinoMesh", "RhinoSurface", "MeshGrid", "Json"])
4749

4850
if option == "RhinoBox":
4951
guid = compas_rhino.objects.select_object("Select a box")
@@ -75,6 +77,9 @@ def RunCommand():
7577

7678
obj = compas_rhino.objects.find_object(guid)
7779
cylinder = compas_rhino.conversions.extrusion_to_compas_cylinder(obj.Geometry)
80+
if not cylinder:
81+
return
82+
7883
mesh = cylinder_to_cablemesh(cylinder, U, V, name="CableMesh")
7984

8085
rs.HideObject(guid)
@@ -85,7 +90,7 @@ def RunCommand():
8590
return
8691

8792
obj = compas_rhino.objects.find_object(guid)
88-
mesh = compas_rhino.conversions.mesh_to_compas(obj.Geometry, cls=CableMesh)
93+
mesh = compas_rhino.conversions.mesh_to_compas(obj.Geometry, cls=CableMesh) # type: ignore
8994

9095
rs.HideObject(guid)
9196

@@ -110,7 +115,7 @@ def RunCommand():
110115

111116
# ------------------------------------------------
112117

113-
mesh = compas_rhino.conversions.surface_to_compas_mesh(surface, nu=U, nv=V, weld=True, cls=CableMesh)
118+
mesh = compas_rhino.conversions.surface_to_compas_mesh(surface, nu=U, nv=V, weld=True, cls=CableMesh) # type: ignore
114119

115120
rs.HideObject(guid)
116121

@@ -131,14 +136,14 @@ def RunCommand():
131136
if not NY:
132137
return
133138

134-
mesh = CableMesh.from_meshgrid(dx=DX, nx=NX, dy=DY, ny=NY)
139+
mesh = CableMesh.from_meshgrid(dx=DX, nx=NX, dy=DY, ny=NY) # type: ignore
135140

136-
elif option == "JSON":
141+
elif option == "Json":
137142
filepath = FileForm.open(session.basedir)
138143
if not filepath:
139144
return
140145

141-
temp: Mesh = compas.json_load(filepath)
146+
temp: Mesh = compas.json_load(filepath) # type: ignore
142147
mesh: CableMesh = temp.copy(cls=CableMesh)
143148

144149
else:
@@ -148,7 +153,7 @@ def RunCommand():
148153
# Update scene
149154
# =============================================================================
150155

151-
meshobj = session.scene.add(mesh, name=mesh.name)
156+
meshobj = session.scene.add(mesh, name=mesh.name) # type: ignore
152157

153158
meshobj.show_vertices = list(meshobj.mesh.vertices_where(is_support=True))
154159
meshobj.show_edges = True

commands/FF_scene_redraw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def RunCommand():
1515

1616
session.scene.redraw()
1717

18-
meshobj: RhinoCableMeshObject = session.scene.find_by_name(name="CableMesh")
18+
meshobj: RhinoCableMeshObject = session.find_cablemesh()
1919
if not meshobj:
2020
return
2121

0 commit comments

Comments
 (0)