Notifications
Clear all

[Closed] simpleObject plugin and Editable_Mesh issue

Hi, i read a lot of tutorial about scripted plugin but i realized that there are too many limitation.
For a game script i need to represent a “surface of vector”, the problem is that i can’t use a Point for each vector, the 3dstudio scene will slow a lot.
So i made some test:

plugin simpleObject SuperMesh
name:"SuperMesh"
classID:#(145345,543212)
category:"Scripted Primitives"
--extends:Editable_mesh
version:1
( 
	local handle = 0
	parameters main rollout:params
	(
		height type:#worldUnits default:10
		width type:#worldUnits default:10
		--depth type:#worldUnits ui:depth default:0
	)

	rollout params "Two Faces Parameters"
	(
		--spinner height "Height" type:#worldunits range:[-1000,1000,0]
		--spinner width "Width" type:#worldunits range:[-1000,1000,0]
	)

	on buildMesh do
	(
		N = 10
		di = width/(N-1.0)
		M = 10
		dj = height/(M-1.0)
		verts = #()
		verts.count = N*M
		for i=1 to N do for j=1 to M do verts[i+N*(j-1)] = [(i-1)*di,(j-1)*dj,0]
		setMesh mesh verts:verts faces:#()
	)
	fn setObjProp =
	(
		$.vertexticks = True
		$.name = uniqueName "SoldierLines-"
		handle = $.handle
	)
	tool create
	(
		on mousePoint click do case click of
		(
			1:(nodeTM.translation = gridPoint ; setObjProp())
			2: #stop
		)
		on mouseMove click do case click of
		(
			2:
			(
				width = gridDist.x
				height = gridDist.y
			)
		)
	)
)

With this solution i can store a lot of information in the Parameters, the Mesh’s vertex can rappresent fast the start of each vector, but there are a big issue:

  1. I can’t change number of points –> the solution can be a script what convert a default mesh into SuperMesh
  2. I can’t edit information for each vector –> the solution can be apply a Edit_mesh modifier to change start of vector
  3. I can’t change the vector orientation , apply a normal modifier can be a perfect solution but work only for a mesh with face…
  4. i can’t represent the “chain” for sorting points

Can someone help me to build this little and very complicated script ?