Home Coding, Scripting, Shaders

[Maxscript] Script not functioning with macroscript.

ngon master
Offline / Send Message
zachagreg ngon master
So I have a basic maxscript or command that I am building out a context sensitive script with later on which is here:
		if selection.count >= 1 do<br>		collapsestack selection

Which works as intended when Evaluating it through the script editor. It will collapse the stack no matter what down to my editable poly. Which is what I want.

Now if I make into this:
macroScript Convert_EditPoly<br>category:"ZMTools"<br>(<br>	if selection.count >= 1 do<br>		collapsestack selection<br>)

It will function as intended if I have anything other than an "Edit Poly" modifier at the top of the stack. If the "Edit Poly" is at the top of the stack it will not go through. No error, no code, nothing. Mind you the script ran from evaluate functions just fine with "Edit Poly" at the top of the stack.

Am I misunderstanding some basic thing here with the functionality of macroscripts? I have also tried this with the following:
macros.run "Modifier Stack" "Convert_to_Poly"
Which follows the same behavior. Attempting to just make a hotkey for convert to poly results in the same behavior as well.



Replies

  • monster
    Offline / Send Message
    monster polycounter
    Look in the Edit Poly Group and Category to see if that hotkey already is in use.
  • zachagreg
    Offline / Send Message
    zachagreg ngon master
    Okay so I went through the Edit Poly group as well as the category of the same. Basically all the ones relevant that I could find and this is what I found.

    This one is the Main UI group with Editable Poly Object group selected. Upon pressing that hotkey it does nothing to my stack regardless of top modifier.


    I was able to find this also in the modifier stack category under the Main UI group.


    Upon setting a keybind to that it functioned the same way as the other scripted methods. It would collapse the stack with anything as the top modifier EXCEPT Edit Poly mod. I'm using Max 2017 if that helps at all? The only thing that was set under the same keybind in edit poly group was extrude mode but i unbound it and same behavior continued.


  • monster
    Offline / Send Message
    monster polycounter
    There's nothing wrong with your script. So it has to be a hotkey conflict. Here's some things to debug:
    • Putting your operation on a toolbar and see if it always work.
    • Turn off Keyboard Shortcut Override Toggle and test
    • Disable the "Active" checkbox in the Edit Poly Group.
  • zachagreg
    Offline / Send Message
    zachagreg ngon master
    Okay awesome, I tested it with a toolbar and it worked. Turned the keyboard override off and it worked, same with the active checkbox. I see what you meant now thank you @monster. As I'm building out this small script I basically wanted the the Extrude tool to function when in face mode and the stack to collapse when in Top-Level mode. 

    Max will respect the individual modes within Edit Poly right? As long as I write the script correctly that is. It won't just default to Edit Poly mode? Or does the active mode just need to be disabled for context-sensitive stuff like that?
Sign In or Register to comment.