Notifications
Clear all

[Closed] MAX 2016: simpleMeshMod test

plugin simpleMeshMod simpleMeshModTest
	  name:"meshModTest"
	  classID:#(0x193aa23b, 0x01010101)
	  category:"Tests"
(
	local test
	on modifyMesh do 
	(
		format "changed: %
" (timestamp())
		mesh
	)
)

could anyone who has max 2016 make a simple test please?
1–

add the modifier above to teapot for example

change any parameter of teapot

and check how many times the modifyMesh handler works


2–

add edit_poly or edit_mesh modifier between teapot and meshModTest

select any sublevel

and check how many times the modifyMesh handler works


3–

go on teapot level and change any parameter

and check how many times the modifyMesh handler works


4–

in listener type

$.meshModTest.test = timestamp()

and check if it affects modifyMesh handler or not

thanks!

8 Replies

1,2,3 – once, 4 – yes, it does

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

good
it means the base modifier don’t use selection channels

bad
it means the base class is probable still the simpleMod which is very old and slow

simpleMeshMod is the thing without what the MCG could not be possible.

it’s the killer of the MCG… in both meanings.

 lo1

I’m not sure I understand the design decisions that necessitate MCG being implemented via maxscript (even if not for heavy lifting). Wouldn’t it be more efficient to tie it directly to C++ classes?

This isn’t a rant, I’m just interested in the considerations.

1 Reply
(@gandhics)
Joined: 11 months ago

Posts: 0

MCG uses maxscript only for UI generation.
Because of this, dev automatically got all UI functionality that Maxscript support and got UI customization for free.

I refresh this thread as it seems there’s not much about “SimpleMeshMod” in this forum.
I’m making some tests and seems to work fine.

In the short mxs doc, they talk about the ‘owningNode’ internal value that holds the node the modifier is attached to. I can’t retrieve it. I just get ‘undefined’.
Has anyone one used it?

Edit: OK, sorry, it works. The problem was I was using it in the ‘onAttachedToNode’ handler.

The owningNode var works as expected for me (it’s only accessible in the modifyMesh scope).

plugin simpleMeshMod owningTest
	name:"____"
	classID:#(0x56266d29, 0x7131ccaa)
(
	on modifyMesh do
	(
		format "owning name: %, vertex count: %
" owningNode.name mesh.numVerts
		mesh
	)
)

select #(Box(), Plane(), Sphere())
modPanel.addModToSelection (owningTest())

-->owning name: Box001, vertex count: 8
-->owning name: Plane001, vertex count: 4
-->owning name: Sphere001, vertex count: 114

Yes, thanks Vojtech.

I had edited my post above. The problem was using it in the “on attachedToNode” handler.
It’s accesible too in the ui rollout handlers (at least using it as ‘this.owningNode’) and as a property of the modifier in code outside the modifier (‘mymodifier.owningNode’).

It works fine.