Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to make 3ds Max start with "World" in Reference Coordinate System

8 REPLIES 8
Reply
Message 1 of 9
yCekyLL
888 Views, 8 Replies

How to make 3ds Max start with "World" in Reference Coordinate System

Hey guys.


I teach Max to architects, we always need to change the coordinate system that is in the Main Toolbar to "World" instead of "View"


It would be very useful and practical to define that Max already starts in "World", mainly for beginning students.

In the old days this was made possible by a file called 3dsmax.ini or something like that, but now I can't find anything corresponding.


Can anyone help?
I thank you for your attention.

 

yCekyLL_0-1689172648661.png

 



Labels (2)
8 REPLIES 8
Message 2 of 9
leeminardi
in reply to: yCekyLL

This works!

 

 

lee.minardi
Message 3 of 9
denisT.MaxDoctor
in reply to: yCekyLL


@yCekyLL wrote:

I teach Max to architects, we always need to change the coordinate system that is in the Main Toolbar to "World" instead of "View"

Yeah... I know this annoying issue...

 

macroscript COORDS_WORLD 
	tooltip:"COORDS WORLD" 
	buttontext:"COORDS WORLD"
	category:"denisT"
(	
	local force_def_coordsys = 
	(
		callbacks.removeScripts id:#force_def_coordsys
		
		callbacks.addScript #postSystemStartup "setrefcoordsys #world" id:#force_def_coordsys
		callbacks.addScript #systemPostReset "setrefcoordsys #world" id:#force_def_coordsys
		callbacks.addScript #systemPostNew "setrefcoordsys #world" id:#force_def_coordsys
		callbacks.addScript #filePostOpen "setrefcoordsys #world" id:#force_def_coordsys
		
		setrefcoordsys #world		
	)
	
	on ischecked do (getrefcoordsys() == #world)
	on execute do 
	(
		setrefcoordsys #world
		--updateToolbarButtons()
	)
)

 

Two options:
Opt #1

Save the code above as .MCR file in one of autoloading directories

 

Opt #2

Copy the code in the Listener and run. The MAX will make a macro for you at
"C:\Users\<yourname>\AppData\Local\Autodesk\3dsMax\<maxversion>\ENU\usermacros\denisT-COORDS_WORLD.mcr"

 

 

For both methods, create a button for this macro script, which can be done like this:

 

denisTMaxDoctor_0-1689546592244.png

 

 

 

 

Message 4 of 9
yCekyLL
in reply to: denisT.MaxDoctor

Hi Dennis, thanks for the suggestion.


But your script works just like a button and can also be activated by a shortcut... But that was already possible with "World Coordinate system - Main UI".


What I would really like is that when starting MAX, it automatically changes to world.

I tried to put your script in the "Additional Startup scripts" folder but it had no effect. 😞

Message 5 of 9
denisT.MaxDoctor
in reply to: yCekyLL

No... If you create a macro button, the coordinate system should switch to "World" every time MAX is loaded, file reset or new file loaded.

Message 6 of 9
yCekyLL
in reply to: yCekyLL

Hello again guys.

I analyzed Denis and Leeminardi's solution and indeed, the use of the "setRefCoordSys #world" command in a script in the startup folder really applies.


But it still has some more complicated problems than I imagined. As you may know the coordinate can be chosen for each tool: ( Select, Move, Rotate, Scale ) and all are originally configured for "View".

The script with just "setRefCoordSys #world" works by changing at startup just to the "Select" tool.

Also, if you switch to another tool and come back to the select tool, you'll see that everything returned the "View" coordinate.


It's actually more complicated than I thought... I just wanted all the tools to start configured for World.

:'(

Message 7 of 9

try the advanced version:

 

macroscript COORDS_WORLD 
	tooltip:"COORDS WORLD" 
	buttontext:"COORD WORLD"
	category:"denisT"
	/*silentErrors:on*/
(	
	local force_def_coordsys = 
	(
		with quiet on
		(
			callbacks.removeScripts id:#force_def_coordsys
			
			callbacks.addScript #postSystemStartup 	"setrefcoordsys #world" id:#force_def_coordsys
			callbacks.addScript #systemPostReset 	"setrefcoordsys #world" id:#force_def_coordsys
			callbacks.addScript #systemPostNew 		"setrefcoordsys #world" id:#force_def_coordsys
			callbacks.addScript #filePostOpen 		"setrefcoordsys #world" id:#force_def_coordsys

			callbacks.addScript #spacemodeChange 	"if not GetQuietMode() do updateToolbarButtons()" id:#force_def_coordsys

			preferences.constantReferenceSystem = true
			setrefcoordsys #world
		)
		true
	)
	
	on isChecked do (getrefcoordsys() == #world)
	on execute do with quiet on
	(
		if (getrefcoordsys() != #world) do 
		(
			setrefcoordsys #world
			updateToolbarButtons()
		)
	)
)

 

 

the button should switch to ON state if the current coordinate system is "world", and to OFF state if the coordinates are any other.

Message 8 of 9
denisT.MaxDoctor
in reply to: yCekyLL


@yCekyLL wrote:

But it still has some more complicated problems than I imagined. As you may know the coordinate can be chosen for each tool: ( Select, Move, Rotate, Scale ) and all are originally configured for "View".

The script with just "setRefCoordSys #world" works by changing at startup just to the "Select" tool.


it's a new condition. it can be solved, too, but it takes some thought.

 

OK. the new version above lets you use a constant Reference System for the Move, Rotate, and Scale tools.

Message 9 of 9
Swordslayer
in reply to: yCekyLL


@yCekyLL wrote:

It's actually more complicated than I thought... I just wanted all the tools to start configured for World.

:'(


Do you want each mode to keep their own coordsys in the future? Because if not, you can check Ref. Coord. System > Constant in the Preferences and all the tools will use the same one all the time.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report