I was trying to make a toggle function between different snap angle values, but much like
this thread says from 2008, there isn't a variable listed in the Max documentation under the snapMode struct page, nor does the MaxListener pick anything up.
Is there a way to modify this value by script nowadays, or no there's been no change at all regarding the situation?
Replies
help.autodesk.com/view/3DSMAX/2016/ENU/?guid=__py_ref_class_max_plus_1_1_snaps_html
Place it in your startup script folder and then you can use it like this:
@Pac_187 My oh my, what black magic is this? How did you do it? Forgive me but the details escape me as I'm a beginner when it comes this subject. I know by placing this in my startup folder Max will read these functions and I'll be able to use them when writing code, but I wonder how inside those functions of yours you're accessing the parameter of the snap angle.
Are these the lines responsible for this?
I see stuff here that I'm not used to dealing with. I see dotNetClass, which in my mind is "okay son we're doing hardcore programming now" and in the docs is something about more classes, objects and methods that were made because some ActiveX (?) stuff got obsolete when transitioning into 64 bits.
I also see COREInterface7, which I can't find anything on in the docs.
If you or anyone else feels like talking a bit about these, feel welcomed to do so
Thank you so much Pac. If you feel like explaining any day what those two lines do, or how can I find out for myself, I'd appreciate it very much. Anyway, thanks again!
In simple terms I'm making use of the 3ds Max SDK using the .NET wrapper which has been released quite some time ago (Max 2012?!).
Using the COREInterface you get access to some part of 3ds Max internals and can interact with stuff that's not exposed to the UI or Maxscript.
So yea, as you guessed this can go a bit deeper than just scripting in maxscript.
Unknown property. "GetSnapAngle" in undefined
If I use the function in the Maxscript listener it works just fine, and somehow, after doing what I still don't know what, the function starts working normally again. But generally speaking, at least as soon as you open Max, the thing will fail. Got any ideas?
This is important, it will force maxscript to look for the variable in the global scope.