Notifications
Clear all

[Closed] GW Text Display Issues

Hello,

I’m new to using the viewport drawing commands, but so far it’s been going fine. But I’ve run into an issue when trying to run this loop, and I’m not sure why… Maybe because of snapshoting meshes and trying to update the display to fast?

Max just freezes when I run this code.



gw.setTransform(Matrix3 1)
	for o in objects do
	(


		local theMesh = snapshotasmesh o
		local numFaces = theMesh.numfaces
		local numVerts = theMesh.numverts

		delete theMesh
	 
		
		gw.text  [o.center[1],o.center[2],(o.max[3]  + (o.center[3] / 6)) ] (o.name) color:White
		gw.text  [o.center[1],o.center[2],(o.max[3]  + (o.center[3] / 8)) ] (numFaces as string) color:White
	) 

	gw.enlargeUpdateRect #whole
	gw.updateScreen()

That is in a function, and I call that function with this other one…



fn fn_44__displayObjSceneNames = 
	
(
	 
	if displayToggleValue == 1 then
	(
		unRegisterRedrawViewsCallback displayObjSceneName 
		displayToggleValue = 0
	)
	else
	(
			displayToggleValue = 1
			registerRedrawViewsCallback displayObjSceneName 
			
		)
	
)

Any Ideas?

Thank you,

Matt

2 Replies

Try using

GetTriMeshFaceCount[font=‘Courier New’] [/font]<node>

instead of the Snapshotasmesh() and see if it changes anything.
The above method returns the face count and the vertex count in an array.

Awesome, that works

Is there any way to get UV Channels use a TriMesh by chance?

Also, is it possible to have a list of text in the GW String, using something similar to
? I’d like to be able to keep all of the info in 1 string instead of doing multiple gw text lines and move them up/down.

Edit: I figured out how to do my text stuff, just not sure about the MAT ID stuff, but I’ll keep poking around.

Thanks again!

Matt