About this site
ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
Comments
Thank you very much ! It is
Thank you very much ! It is what I needed
I just "made" a little script as always in frankenstein style.
The marvelous fonction is from ZalitZ
If it can be helpfull to somebody.
Script : Toggle Mixer Mode from the selected skinned mesh.
You're welcome
Here is an optimized version of your script
I've removed some "select" stuff that wasn't needed, also removed all the "hidden"check stuff from the function, and add it back in the end to ensure that the zoom on selection at the end works even if the selected object is hidden (it could be selected in the layer manager but hidden in the viewport), i've put the "pelvis search into the function to avoid creating two arrays with all the bones names and nodes, you only needed the pelvis to be returned by the function, adding "max create mode" makes it much faster as in this case you don't need to be in modify mode (sometimes it is required, but not in this case).Declaring every variable as local is not neccessary in this case if all the code is within parentheses, but i like to do so anyway, it is more for clarity and readability. In your code, variables were just declared without being within parentheses, it was creating some global variables that can be problematic in certain case, enclosing your code within parentheses avoid creating global variables as maxscript automatically declare variable as local if within parentheses. I also added a redraw off to even further speed up the process ;)
Hi ! Thank you very much
Hi ! Thank you very much !
But a ")" is missing at the end ;-)
I think I'll never do a clean script in my all life...
In some cases, I get :
-- MAXScript FileIn Exception:
-- Unknown property: "mixerMode" in Controller:Position_Rotation_Scale
( with RenderPeople rigged )
you're welcome
Don't worry i am kind of messy too, I try to get better at it ... There is always stuff to learn...
In fact it wasn't a missing ")" at the end, but it was an extra "("at the begining, before the beginning of the function GetPelvisBones.;)
I've check the "RenderPeople rigged" setup and the problem comes from the fact that the pelvis object isn't included in the skin modifier so the function return undefined, you can add the pelvis to the skinmodifier, the script will work fine...
but i came up with something that will work even on RenderPeople rigged characters:
in this version i collect all bones hierarchy even if they aren't in the skin modifier and then i filter only the one that has a "mixerMode" property, this way it will likely work in most cases, i hope...
the way i build the hierachy array could surely be better written, but it works...
Hi Simon. Thank you very much
Hi Simon.
Thank you very much again !
Now it works like a charm !
I think I can live with the hierarchy array as it is written :-)
Best
You're welcome
Me too :)
if you apply the script to an object that doesn't have any skin modifier it crashes, so here is a modified version, it will return a warning message instead of crashing:
Cool !
Cool !
Hi,
You can use this: