Hi,
I'd like to set some scene preferences with python. e.g. turing autobackup on, setting the path for autobackup (if this is possible) and the name for autobackup, turing on compress on save and so on. Is this possible and if yes, how?
And I need a way to list all missing external files with python.
I aprecciate any help. Thanks.
Solved! Go to Solution.
Solved by drew.avis. Go to Solution.
Hi, it doesn't look like MaxPlus exposes this functionality directly. You can get to the autosave settings via the MAXScript autosave interface through pymxs. See http://help.autodesk.com/view/3DSMAX/2017/ENU/?guid=__files_GUID_B5405D51_E4D7_4448_9588_8D06B873578...
For example:
from pymxs import runtime as rt autosave = rt.autosave print "Autosave enabled? {}".format(autosave.enable) print "Autosave filename: {}".format(autosave.filename)
Very cool, thanks a lot. This will help. And a very similiar question:
I've tried to set the "Reference Coordinate System" in the toolbar to "World". With maxscript it works fine:
toolMode.coordsys #world
but the same in python:
pymxs.runtime.toolMode.coordsys("#world")
causes an error:
Traceback (most recent call last): File "<console>", line 1, in <module> RuntimeError: MAXScript exception rasied. -- Runtime error: Illegal coordsys mode type: "#world"
Any ideas?
You just need to cast the MAXScript name value as a pymxs.runtime.Name:
pymxs.runtime.toolMode.coordsys(pymxs.runtime.Name("world"))
Works fine, great. Now I can set the toolMode.coordsys, but how can I query it? A simple:
cs = rt.toolMode.coordsys()
results in an error message, it needs an argument. Any ideas?
Try:
cs = pymxs.runtime.getRefCoordSys()
toolmode.coordsys() only sets the value.
Drew
Pymxs does not expose the "in coordsys" context expression, but transforms on the node should be in the node's local coordsys. Here's a simple rotate on a box:
from pymxs import runtime as rt b = rt.box() a = rt.angleaxis(20.0, rt.Point3(0,0,1)) rt.rotate (b, a)
This will produce the same result no matter what the toolMode setting is.
Does that answer your question?
Drew
I wish that was an option the only way I can zero out the parent coodsys is using an eval. Was hoping to do achieve the same thing using pymxs.
MaxPlus.Core.EvalMAXScript("coordsys parent $'%s'.pos = Point3 0 0 0" % node_name)
MaxPlus.Core.EvalMAXScript("coordsys parent $'%s'.rotation = Quat 0 0 0 1" % node_name)
In PyMXS, any MaxScript constant value, starting with a # character, is considered a pymxs.runtime.Name object, which is constructed from a string without the # character. Specifically:
import pymxs mxs = pymxs.runtime mxs.toolMode.coordsys( mxs.Name( "world" ) )
A little late to the party here, but in case anybody else stumbles on this ...
Michaelson Britt
Can't find what you're looking for? Ask the community or share your knowledge.