Notifications
Clear all

[Closed] calling 3Ds max functions through maxscript

Hello all,
Is there a way to call already coded max features, say like drag creating a plane, using maxscript without recreating the whole process yourself? Namely I am looking for the drag creation of a plane and the addition of height and width segments. I know it would be faster to run those and also save me a lot of work.
Thanks

4 Replies
1 Reply
(@gazybara)
Joined: 11 months ago

Posts: 0

I don’t know if I understand you correctly but here is a example

fn setPlaneProps pln createMtd:2 lSegs:4 wSegs:4 genMapCoords:on rwMapSize:off \
 wc:blue mtl:(Standard diffusemap:(Checker color1:yellow color2:green) showInViewport:on) =
 (
 	pln.typeinCreationMethod = createMtd
 	pln.lengthsegs = lSegs
 	pln.widthsegs = wSegs
 	pln.mapCoords = genMapCoords
 	pln.realWorldMapSize = rwMapSize
 	pln.wirecolor = wc
 	pln.mat = mtl
 )
 bluePlane = startObjectCreation plane returnNewNodes:#first newNodeCallback:setPlaneProps

sorry, to clarify, what I mean is when you click on the create tab and hit the plane button in max it allows you to drag out a plane or create one off of the list of properties. If you look at the macroscript for that button it doesn’t really give much information or code, I assume its because its going to c++ code after that. Is there a way to reference that same code that the button uses so i don’t have to recode my own mouse drag create plane function?
thanks

Thank you very much this is exactly what i was looking for.

So i’ve been running with this and got the basics working but i’m having a few problems. One is that I’d like to set the dimensions of the plane to a ratio so that when you drag up its gets larger using that ratio. The second is that I can’t tell when its stopped and the plane is created, is there a value or parameter i can check to see if startObjectCreation is done? I’ve been trying to find stuff through google/help docs but not finding a lot other than the very basics under “create panel”
Heres my code:

on dragBt pressed do
	(
		getBitmap("drag")
		maxOps.autogrid = autoGridCb.state
		picture_Frame = startObjectCreation plane returnNewNodes:#first newNodeCallback:setPlaneProps
		if not (isCreatingObject()) then
		(
			print "its in"
			picture_Frame.length = (picture_Frame.width * (in_bitmap.height / in_bitmap.width)) as float
			extrudeFrame()
			coordsys #local move $ [0,0,.1]
		)
	)

my problem is that if i don’t have the isCreatingObject if statement it will try to run the code before the object is done being created, but in the if statement it doesn’t run it at all. Kind of confused
thanks again
D3Mi