Been all morning trying to figure this one out. I have these lines to let me hide faces/objects:
if Ribbon_Modeling.isFaceMode() then
macros.run "Editable Polygon Object" "EPoly_Hide"
else
actionMan.executeAction 0 "223" -- Tools: Hide Selection
And it works great, except for when i want to hide faces from multiple objects being grouped under an Edit Poly modifier. The error simply displays "Operation failed"; no explanation in the Maxscript Listener, nothing.
Any ideas as to what's wrong? Does the macros.run function not work when called in an instanced modifier?
Replies
Thank you yet again Juan. Do you know how can I see in the MaxScript Help docs all functions under Ribbon Modeling? I actually spent a good while searching there, because since our last talk yesterday now I knew to look there before giving up, but no keywords I used gave me anything useful. At most, the only thing I ever found there was the Ribbon interface controls...
I always use the Scripting & Customization filter when looking for Maxscript stuff. Am i doing it wrong?
You can hide faces on Editable Poly via:
Justo and I had PMs where I suggested using ribbon functions since those already check for EPoly vs EditablePoly states.
@Justo
A better way than what I suggested earlier (because ribbon handles vert mode as well) is to not check for face mode, just check if your are in object mode.
As for as help docs, this stuff isn't documented. Like I suggested earlier macros.edit will show the code used in any macro. And you can open the PolyBoost.ms (or something like that) in the 3ds Max install folder. Some commands like this will output their functions
I'm really curious though, since I've never ran across the need to do so making game art, at what times have you needed to hide verts? I can't think of a situation in which that'd be truly necessary, unless I was editing some really highly decimated mesh and I wanted to hide vertices as I edit the shape with soft selection (that would still be a bit uncomfortable though, I think).
iirc I put that there to fix some sort of bug in an older version of Max I was using at the time. Probably no reason to have it there in modern versions of Max, but no real reason to remove it either. I don't ever really hide just verts.
Here's my full hide/unhide script, which does work for single and multiple Edit_Poly modifiers, and well as Editable_Poly:
Unless you're really concerned about how compact your code is, I don't see any reason to use a different method then what I posted above.
Ahh, I see Greg. And yes, I've also never had to hide verts...ever.
Your script works great. It's not that I'm concerned on how compact it is, but I simply do not understand why not use monster's lines haha. Unless I'm mistaken, and if so by all means I'd love to learn, he summed up in four lines all funcionalities of what you did. Is that not so?
However, I prefer my method because it's easier to fix should a newer version of Max changes something that results in it breaking (Like monster said; what he's showing isn't documented). Also, if for some reason I end up having to use a really old version of Max, I know it'll still work, where as I'm not sure how backwards compatible the ribbon method is.