Notifications
Clear all

[Closed] Scripted plugin minus boolean

Hi!

I’m scripting a simpleObject plugin where my mesh consist of several primitives added together as one mesh using += myBox.mesh,+= mySphere.mesh etc… Is there an alternative method that attaches the parts together instead of booleaning the final result? I’m trying to avoid constructing the mesh from ground up, since I only need shapes that exist already.

Best,

Kresten

2 Replies

Ohh – used trimesh meshop.attach instead that did it…

I know I’m kind of talking to myself here… But I’ve faced a new problem:

I’ve created my geometry plugin using simpleObject, and it’s working great. Except I would really like it to be a shaded helperobject and place it in the “Systems” category like bones.

For instance, does anybody know if it is possible to convert this samplecode into a shaded helper? I tried in a lot of different ways using boneclass, helperclass etc. with no luck

plugin simpleObject squareTube
name:"SquareTube"
classID:#(63445,55332)
category:"Scripted Primitives"
( 
	local box1, box2
	parameters main rollout:params
	(
		length type:#worldUnits ui:length default:1E-3
		width type:#worldUnits ui:width default:1E-3
		height type:#worldUnits ui:height default:1E-3
	)
	rollout params "SquareTube"
	(
		spinner height "Height" type:#worldUnits range:[1E-3,1E9,1E-3]
		spinner width "Width" type:#worldUnits range:[1E-3,1E9,1E-3]
		spinner length "Length" type:#worldUnits range:[-1E9,1E9,1E-3]
	)
	on buildMesh do
	(
		if box1 == undefined then (box1 = createInstance box; box2 = createInstance box)
		box1.height = height
		box2.height = height
		box1.width = width
		box2.width = width * 2
		box1.length = length
		box2.length = length * 2
		mesh = box2.mesh - box1.mesh
	)
	tool create
	(
		on mousePoint click do
		case click of
		(
			1: nodeTM.translation = gridPoint
			3: #stop
		)
		on mouseMove click do
		case click of
		(
			2: (width = abs gridDist.x; length = abs gridDist.y)
			3: height = gridDist.z
		)
	)
)