I have a lot of objects I want to shrinkwrap individually to basically reduce the number of faces of some meshes of scanned people.
When I shrinkwrap 1 geometry I can tweak the settings to how I want and press okay. Since there seem to be defaults for everything except target edge length, where a default is calculated, am I correct in thinking the only way to repeat this is to enter the settings manually for each geometry and do them 1 by 1?
Couldn’t there be an option to keep the last settings? Then I could just right-click to repeat the command and press enter, which would be okay if its like 10 or so objects.
Is Grasshopper once again the only way to do it for many objects at once with the same settings?
I have to say Rhino really lacks when it comes to editing many objects at once. Box Edit is great in theory, but is very limited when it comes to many objects. Why can’t we move many objects to a certain point again? It would be so easy to add an option for position to be either relative or absolute. Weird decision making to not have that.
ShrinkWrap resets its values only if the object selection is changed, otherwise it does keep the last values you used. We decided to do this during the WIP to keep users from accidentally putting in values that could cause a system freeze or instability as we were seeing a lot of that. So when a new selection is made a loose target edge length gets presented.
However, there are lots of ways to batch automate within Rhino.
You could do what you’re after in several ways from either a command line macro, a basic script, or as you already mentioned, Grasshopper.
Here’s a basic script you could put into a button. Change the values of the sw_params to suit your needs.
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
def shrink_wrap_selected_objects():
doc = sc.doc
# Get selected objects
selected = rs.GetObjects("Select objects to shrink wrap", preselect=True)
if not selected:
return
# Convert selected objects to Rhino geometries
geometries = [doc.Objects.Find(obj).Geometry for obj in selected]
# Set ShrinkWrap parameters
sw_params = Rhino.Geometry.ShrinkWrapParameters()
sw_params.TargetEdgeLength = 0.1
sw_params.Offset = 0
sw_params.SmoothingIterations = 0
sw_params.InflateVerticesAndPoints = True
sw_params.FillHolesInInputObjects = True
sw_params.PolygonOptimization = 10
# Apply ShrinkWrap to each geometry and add the resulting mesh to the document
for geo in geometries:
shrink_wrap_mesh = Rhino.Geometry.Mesh.ShrinkWrap([geo], sw_params, Rhino.Geometry.MeshingParameters.QualityRenderMesh)
if shrink_wrap_mesh:
doc.Objects.AddMesh(shrink_wrap_mesh)
doc.Views.Redraw()
# Run the function
shrink_wrap_selected_objects()
What I would be after would be a way to repeat with the last settings OR to be able to select multiple objects and shrinkwrap them separately but with the same settings. The settings are not fixed though. It’s more that once I fine-tuned the settings of one, I want to apply the shrinkwrap with the same settings to all of them.
I guess I could just arrange all the geometries next to each other and shrinkwrap them all at once, then split the mesh into separate meshes.
I guess you could have a checkbox, which is on by default, to “Use Automatic settings”. That way I can disable it and it will remember the last settings.