So, I'm looking for a script in max that will function similar to "split loop" in Silo, or a similar feature I've seen used in maya.
In silo, you click an edge, hold a key down and move the mouse to slide where the loop will end up. Release the key to commit. Otherwise, it just splits the loop at the center (just like max Connect). Quick vid to see what I mean:
http://vimeo.com/2452071
To accomplish the same thing in Max, I usually I do this:
1)select edge
2)ring select
3)connect options/slide
which works great, but is way slower. I've also seen something in maya, where you just click the edge with the mouse and it inserts a loop at the cursor (no sliding).
I believe polyboost does this, but I was hoping to not shell out $150 for only one feature.
Replies
I was wondering if such thing was available for Max ... yesterday!
http://www.robg3d.com/temp/csConnectAndSlide.ms
Just run the script and you should get a Macro under "csPolyTools" called "Connect and Slide"
What version of max is this for?
one thing u should know is that if u space out and use the macro without a edge selected it crashes the max viewport.
i dont know how scripting works but i think what you would have to tell it to do is select the edge that ur clicking on and then run the rest of the script.
Max 6 and up, I think... definitely max 8 and up though.
Just a note, if you have multiple edges selected when you do this, it doesn't really work right... this is just a problem with the way the 'slide' tool is implemented in csPolyTools, and not something I'm going to rewrite right now.
Maybe someone can get this to work 100% of the time. http://www.bryancavett.com/edgeSlice.ms
I'm getting the length of the first edge and a point clicked on the edge. Getting a percent from it and using it on the slide option for the connect command. Then I run a edge ring and connect with the new slide settings. Sometimes it works right and sometimes when i get a negative number for the percent(which is how the slide numbers work) it adds it to the positive side even though the percent variable says its negative.
Anyways its almost there.
Run the script and you will see a new category called "BCTools"
Make sure 3d snap mode is on with edges picked. (I cant find out how to set it up in MXS)
Select one edge and run it.
Left click where you want to cut the edge.
Here it is inline if you don't wanna d/l
My GOD I cannot believe I missed that. I really hate Editable Poly maxscript stuff. This is the umpteenth time I've looked for other ways to do things when the answer was hidden in one of the 25 sections with editable poly commands. God I hate you Max.
Is there a way I can test the new vert positions based on a tolerance to my original hitpoint position? I thought maybe I could test the angle of their vectors from the origin or something. But then there is the problem of how do I undo that code and redo it with an inverse value of the percent. try() catch()? I cant seem to get this working. Any help would be appreciated.
If Rob and Bryan joined forces, we'd have a case of epic win on our hands here.
It's very intuitive.
[edit] Oops, I saw at the bottom you mentioned already knowing about this with polyboost. My bad
Hope it helps your workflow.
The code is kinda hacky to... Rob probably knows a better way of doing this.
Edit: Also I can make the ctrl, alt, and shift buttons do something different when they are held down as you left click.
Something like split the edge 50/50 when ctrl is held down.
Maya's implementation of this tool is actually very, surprinsingly good!
I can't find this tool anywhere in polyboost? I'd assume it'd be in the modeling tools?
edit: going through the list of commands it looks like its buried in polydraw! time to bind this sucker.
Also, it's not resetting the 'connect' dialog options, so if you happen to have your connect options set with like 3 segments + pinch + slide, it totally wacks out the edgeSlice. In fact, last night this happened, I reset the connect values to zero, then Max crashed when running the script. Hasn't happened again yet, though.
It will also wig out if you click on an edge that is not the one you have selected since it tests the hit point on the length of the selected edge to determine the percent.... maybe I should just cap the percent if you click on a different edge.
Resetting the connect dialog should be easy.
By the way... I'm kind of a noob when it comes to doing more complex things in MXS. Anything beyond simple automation, if/then statements , or loops and my coding really gets hacky. If any of you guys can get it working better then I can see what I did wrong!
Let me know if you find more. http://www.bryancavett.com/edgeSlice.ms
quick edit: found one more bug and updated
edit 2:One more ninja edit
I guess the slice plane does have the drawback that it will slice through any parts of the mesh it touches, so it would be really hard to add resolution to a single chair leg for example, but how often does that come up?
Also is there any reason to do it as a MS as opposed to a mcr? It looks like executing the ms actually created the corresponding mcr in my UI/Macroscript folder. I don't know if this is common practice anyways (just found it a bit confusing)
On a side note, I can run Rob's version just fine!
The reason why its a .ms instead of a .mcr is so you can run it once and let max place the macroscript where it needs to be placed. All new macroscipts that are ran from a .ms file get placed in the my documents max folder instead of where the base max folder is. It's something I heard bobo from cgtalk explain.
I've found another bug.... its the same scale bug I thought I fixed. If you make a box that is 1000 units tall or wide then my checking to see if the edges are flipped breaks down.... need to find a proper way to scale the value I'm using for the tolerance.
Ill keep you guys posted... hopefuly I'll get it there. Sorry for all the changes and bugs
bryan: dont worry about it dude, thanks for getting it even this far. I've only had buggy issues in maybe 3 of the 400 times I used it the other day.
http://www.bryancavett.com/edgeSlice.ms
I'm glad to share IC_PolySplitRing script. This is my 3ds Max version of the most required Maya tool. Get it freely from IllusionCatalyst website in the MaxScript page.
The script has been thoroughly tested, anyhow please report any issue.
Thank you, enjoy!
- Enrico