Home Technical Talk

Script: Silo style tools in max

polycounter lvl 9
Offline / Send Message
r_fletch_r polycounter lvl 9
I use Silo alot for organic modeling, its workflow is extremely well optimised for working quickly, I have had to switch more to max recently though as its simply a better tool for hard surface modeling. to ease the transition i wrote a few scripts to emulate silos modeling flow in max.

mainly they composite similar tools in max into 1 click context sensitive tools. one usefull thing this adds is a callback which monitors selections and supplys a way of maintaining subobject selection order(max doesnt do this it orders selections by subobject index)

rt_break:
Context sensitive break based on sub object level. this merges: vertex break, edge split, and polygon detach into 1 context sensitive command.
Special cases:
Shift clicking in polygon mode detaches polygon selections to new nodes.
breaking borders creates a new spline shape based on the border.

rt_cut: Context sensative cut. If no Subobjects are selected the cut tool is activiated.
Special cases:
2 or more verts selected. the verts are connected in the order they were selected. not based on face triangulation.
1 edge: the edge is divided with a vert in the middle
2 or more edges: the edges are connected.

rt_merge: Merge tool, mixes collapse and target weld contextually
Special cases:
2 verts: target weld first selected vert to last selected vert
3 or more verts: collapse verts to average point
2 or more objects: objects are attached to first object in selection.
otherwise this tool works like collapse


all tools are written for use with editable poly objects.


to install put the script in your max scirpts/startup folder and restart max.
go to customize UI and the macros are found under "rt Poly Tools"
www.robertfletcher.org/public_files/Scripts/rt_contextual_poly_tools.ms

Replies

  • Yozora
    Offline / Send Message
    Yozora polycounter lvl 11
    I love things like these, I just tried rt_break and its kinda cool, although I very rarely break vertices. I like the create shape from border and the detach to element without a popup window asking if you want to detach to element or object each time.
    It doesnt seem to do anything in edge mode though, I replaced the edge split with create spline instead (same as border one).


    As for the other 2 macros, I'm using a script that perna originally wrote (I edited the vertex connect thing to target weld instead and added the "attachnodes" function from syncviews' IC.shape, delete the last "else" line if you dont have IC.shape installed or replace it with your own "quick-attaching" macro - you might wanna change target weld back to vertex connect though if you dont have a hotkey for connect.)

    I personally use the connect hotkey because I often go into connect settings and many times when I connect I want it to remember the previous segment/pinch/slide settings, useful for control edges.
    And when I go into vertex mode, the connect hotkey will connect the vertices as well while still maintaining the saved edge-connect settings. When I want to just connect in the middle of a selection of edges I use the script below. Point is, I think its handy to have 2 different edge-connecting hotkeys for different jobs :p

    It combines your rt_cut and rt_merge kind of. I still have collapse as it's own hotkey because 3d max's collapse is already context sensitive (aside from in object mode... cant think of anything to put there right now though).

    (
    -- SmartCreate - Context sensitive create by perna
    -- Vertex mode:
    -- Target Weld

    -- Border mode:
    -- Cap border

    -- Edge mode:
    -- If only 1 selected edge, will divide it
    -- If a valid bridge selection, will bridge edges
    -- Otherwise will connect edges

    -- Face mode:
    -- If less than two faces selected, will enter create face mode
    -- Otherwise will bridge the polies

    -- Object mode:
    -- Attach nodes (requires IC.shape)
    if (subobjectlevel==1) then --Vertex SO
    macros.run "Editable Polygon Object" "EPoly_TargetWeld"
    else if (subobjectlevel==3) then --Border SO
    macros.run "Editable Polygon Object" "EPoly_Cap"
    else if (subobjectlevel==2) then( --Edge SO
    if (((polyop.getEdgeSelection $.baseobject)as array).count == 0) then
    macros.run "Editable Polygon Object" "EPoly_ECreate"
    else if (((polyop.getEdgeSelection $.baseobject)as array).count == 1) then(
    $.EditablePoly.divideEdge (((polyop.getEdgeSelection $.baseobject)as array)[1]) 0.5 select:on --Divide Edge
    subobjectLevel = 1
    )else(
    $.bridgeSelected = 1
    if ($.EditablePoly.Bridge () == false) then(
    $.connectEdgeSegments = 1
    $.EditablePoly.ConnectEdges ()
    )
    )
    )else if (subobjectlevel > 3) then( --Poly/Element SOs
    if ((($.GetSelection #Face) as array).count < 2) then
    macros.run "Editable Polygon Object" "EPoly_Create"
    else(
    $.bridgeSelected = 1
    $.EditablePoly.Bridge ()
    )
    )
    else
    try ( rol_IC_Shape_Main.scriptBin.rollouts[3].btAttachNodes.pressed() ) catch ()
    )


    Thanks! I hope more people throw in their context sensitive scripts into this thread :)
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    excellent :D this could be very productive indeed. thanks for posting your code.

    you know with stuff like this:
    macros.run "Editable Polygon Object" "EPoly_Cap"
    
    you can type
    macros.[B][COLOR="DarkOrange"]edit[/COLOR][/B] "Editable Polygon Object" "EPoly_Cap" and grab the bit of code you need.
    

    theres lots of interesting stuff hidden behind the shipped macro scripts.
  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    I'd like to port a more Silo and Modo feel to 3dsMax someday with nifty context sensitive and useful scripts/ tools, this sounds nice.
    In particular what I like about Silo and what max lacks a lot is:
    • instant shortcut assignment
    • more context sensitive (whatever sub mode you are on, it works as you need it)
    • quick GUI placement and customization (change workspace on the fly without going to some hidden and cryptic setup page)
    • fast
    I was never a fan of macroscripts or using them at all (just to much work, not worth it often), so I started once this side project MZP Rucksack
    http://boards.polycount.net/showthread.php?t=63675
    which is a single floater that opens if you drag a MZP file into the viewport without the need to install anything. Like a army knife that you can customize within the MZP file and share with others. Oh and being able to assign shortcuts from within the panel is a goal of that.
    mzprucksack.jpg
    Something like that with a set of Silo alike scripts would be nice.

    If I get some extra time off soon I might look into it again
  • BeatKitano
    Offline / Send Message
    BeatKitano polycounter lvl 16
    Damn nice r_fletch_r, i missed the all purpose merge/weld of silo when switching to max. I made my version of your other scripts though.

    Anyway it's nice to know that some people also value the contex sensitive tools of silo :)

    One thing that bothers me though, in silo if you extrude an edge, it doesnt change the geometry at the base of that extrude, in max it creates new planes on the base. Is there a way to change that in max, or it must be done with scripts ?
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    BeatKitano: Glad you like it man, im 90% through surface snapping. its just a bit too fidgety at the moment.

    Renderhjs:
    i use macros for the 'isEnabled' clause. I find its a nice way of taking care of error checking and forgetting about it.

    That rucksack idea is very nice. I take it you can make it install as a permanent feature aswell?
    have you tried implementing code drag and drop?
  • Michael Knubben
    A suggestion if I may: Sticky keys and selection highlighting!

    Those are two things I miss terribly from Silo when in Max, maybe even moreso than the tools themselves.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    selection highlight is already in max, since max 2008. admitidly it doesnt do the mouse over stuff silo does.
    snip_selection_preview.png

    sticky keys i dont know about. that would require some tinkering
  • Calabi
    Offline / Send Message
    Calabi polycounter lvl 12
    Selection highlighting can be flaky though, I was getting it highlighting the back of the model.

    I think this helps the widget work a bit like the widget in silo. Its certainly quick and usefull.

    http://boards.polycount.net/showpost.php?p=1004546&postcount=17
  • Yozora
    Offline / Send Message
    Yozora polycounter lvl 11
    r_fletch_r wrote: »
    selection highlight is already in max, since max 2008. admitidly it doesnt do the mouse over stuff silo does.

    This thing is broken though, when you hold ctrl, it highlights anything behind the mouse pointer temporarily until you let go of ctrl.
    I guess people can live with it since it doesn't introduce any unnecessary actions, but it messes with your head :p
  • rasmus
    Don't know if you've mentioned it in different terms, but one thing I've seen from guys using Silo is the way all selectable elements have an "invisible" hotzone bigger than just the visual size of the element, as opposed to Max (and especially Maya) where you really have to click EXACTLY on your vert/edge/face to select it. A small thing but so enormously underrated, I feel. This would be awesome to have in Max. What do you say guys?
  • Bal
    Offline / Send Message
    Bal polycounter lvl 17
    Rasmus, I'm pretty sure you can configure that in Maya, can't remember where but it shouldn't be too hard to find (Don't have Maya here...) Don't think so in Max though, probably not so easy to add.

    Nice work r_fletch_r, will try these out.
  • Michael Knubben
    r_fletch_r: haha, I know. But it's unusable. Holding ctrl makes you select everything you hover over, which makes it a pain to work with.

    edit: ah, Yozora already mentioned this.
    I tried to explain why this was bad to my coworkers, but they just said 'hey, this is neat!' and then proceeded never to use it (because it's not neat. Fuckers)

    Although, I should add, it doesn't just 'temporarily' highlight thing, it also selects all those things if you then click.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    i never really used it in silo to be honest. I saw it in max, turned it on then off again.
  • renderhjs
Sign In or Register to comment.