Adjust loops (Loop Tools) script

Hi!

I need to get script of Adjust Loops of Loop Tools (graphite - modeling - loops - loop tools) or only a method. In MaxHelp documetation there is all except adjust loop group

Documentation

EDIT:
in PolyTools.ms i found usage of PolyBAdjustSpinner1 . I see that this method controls behavior of loops. But i dont know how its arguments controls everything at all :< (i cant find code of this method itself)

EDIT2:
PolyBAdjustSpinner1 [autoLoop:bool] [spinnerValue: int] [spinnerPercent: int] [? :int]

spinnerValue: i dont understand how its work
spinnerPercent: this value controlls movement of edges
? - 0: save edges do operation; 1: move edges ... im dont quite sure how its works (PolyBAdjustSpinner1 bool 0 0 1 - saves ... PolyBAdjustSpinner1 bool x x 0 - moves)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Drathir's picture

Thanks for answer :). Ill

Thanks for answer :). Ill check it as soon as possible. Now im fighting with something else (there will be another post on forum :P )

miauu's picture

.

spinnerValue: int -- this is the value of the PolyBAdjustSpinner1. In the UI you can't see the value of the spinner, because only the Up and DOwn arrows are visible. You can modify the fieldwidth propertis of the spinner to see their values. Here the code, grabbed from PolyTools.ms and changed, so you can execute it and see the UI. I don't have the time to rearange the UI, so you have to do it.

--------

    rollout PBo_Flowmain "Loop Tools"
    (
        checkbox autol "AutoLoop" checked:false
--         group ~GROUP_MESHFLOW_CAPTION~
--         (
--             button Fconnect ~FLOWCONNECT_BUTTONTEXT~ height:17 width:70 tooltip:~INSERT_LOOPS_EDGES_ADJUST_MESHFLOW~ offset:[-10,0]
--             button Flowset ~SET_FLOW_BUTTONTEXT~ height:17 width:70 tooltip:~ADJUST_LOOPS_EDGES_TO_MESHFLOW_USE_SPINNER~ offset:[-10,-2]
--             spinner Flowspin "" range:[-1000000.0,1000000.0,0] fieldwidth:0 scale:0.1 offset:[4,-21]
--             spinner Fspeed ~SPINNER_SPEED_CAPTION~ range:[1,400,4] fieldwidth:32 type:#integer offset:[0,2]
--         )
        group "Adjust Loop"
        (
            bitmap loopbit1 filename:((GetDir #maxroot) + "stdplugs\\stdscripts\\(PolyTools)\\Images\Loops.bmp") offset:[-34,0] width:24
            spinner Tightspin ""  range:[-1000000,1000000,0] fieldwidth:40 offset:[-52,-28]
            bitmap loopbit2 filename:((GetDir #maxroot) + "stdplugs\\stdscripts\\(PolyTools)\\Images\Loops2.bmp") offset:[18,-23] width:24
            spinner Tightspin2 ""  range:[-1000000,1000000,0] fieldwidth:40 offset:[0,-28]
            spinner tperc "" range:[1,99,5] fieldwidth: 32 type: #integer scale:5 offset:[0,4]
            button centloop "Center" height:17 width:49 offset:[-26,4] --tooltip:~CENTER_LOOPS_EDGES_ON_EDGE_RING~
            button spacloop "Space" height:17 width:49 offset:[25,-22] --tooltip:~SPACE_LOOPS_EDGES_VERTS_ALONG_LOOP~
        )
        group "Curvature"
        (
            button curvloop "Curve" height:17 width:49 /* tooltip:~CURVE_LOOP_TOOLTIP~ */ offset:[-26,-2]
            button strailoop "Straight" height:17 width:49 /* tooltip:~STRAIGHTEN_LOOP_TOOLTIP~ */ offset:[25,-22]
            checkbox biascheck "Space Loop" checked:true align:#center /* offset:~BIASCHECK_OFFSET~ */
            button circloop "Circle" height:17 width:49 /* tooltip:~TURN_LOOP_INTO_A_CIRCLE_TOOLTIP~ */ offset:[-26,-2]
            button smootloop "Relax" height:17 --width:~SMOOTLOOP_WIDTH~ tooltip:~RELAX_LOOP_TOOLTIP~ offset:~SMOOTLOOP_OFFSET~
        )
       
        on circloop pressed do
        (
            PolyToolsModeling.CircleLoop autol.state
        )
        on strailoop pressed do
        (
            PolyToolsModeling.StraightLoop autol.state biascheck.state
        )
        on smootloop pressed do
        (
            PolyToolsModeling.RelaxLoop autol.state
        )
        on curvloop pressed do
        (
            PolyToolsModeling.CurveLoop autol.state biascheck.state
        )
        on spacloop pressed do
        (
            PolyToolsModeling.SpaceLoop autol.state
        )
--         on PBo_Flowmain close do (PolyBoost.PBo_Flowmainpos = getdialogpos PBo_Flowmain)
        --on Fconnect pressed do PolyBoost.Flowfunc autol.state
--         on Flowset pressed do
--         (
--             if subobjectlevel == 2 then PolyBSetFlow autol.state keyboard.shiftpressed
--             else if subobjectlevel == 1 do PolyBSetFlowVertex()
--         )
--         on Flowspin buttondown do
--         (
--             PolyBoost.FlowSel = PolyBGetSel 2
--             PolyBSetFlowSpinner autol.state 0 0 1
--         )
--         on Flowspin buttonup do
--         (
--             Flowspin.value = 0.0
--             PolyBAdjustUndo PolyBoost.FlowSel
--         )           
--         on Flowspin changed val do
--         (
--             PolyBSetFlowSpinner false val Fspeed.value 0
--         )
        on centloop pressed do
        (
            PolyToolsModeling.CenterLoop autol.state
        )
        on Tightspin buttondown do
        (
            PolyBoost.FlowSel = PolyBGetSel 2
            PolyBAdjustSpinner1 autol.state 0 0 1
        )
        on Tightspin buttonup isCancel do
        (
            Tightspin.value = 0
            if isCancel then PolyBAdjustCancel PolyBoost.FlowSel
            else PolyBAdjustUndo PolyBoost.FlowSel
        )
        on Tightspin changed val do
        (
            if subobjectLevel == 2 do PolyBAdjustSpinner1 false val tperc.value 0
        )
        on Tightspin2 buttondown do
        (
            PolyBoost.FlowSel = PolyBGetSel 2
            PolyBAdjustSpinner2 autol.state 0 0 1
        )
        on Tightspin2 buttonup isCancel do
        (
            Tightspin2.value = 0
            if isCancel then PolyBAdjustCancel PolyBoost.FlowSel
            else PolyBAdjustUndo PolyBoost.FlowSel
        )
        on Tightspin2 changed val do
        (
            if subobjectLevel == 2 do PolyBAdjustSpinner1 false val tperc.value 0
        )
    )
    createdialog PBo_Flowmain --~PBO_FLOWMAIN_X2~ 208 157 344
    --PBo_Flowmainpos = undefined
--     if PBo_Flowmainpos != undefined then
--     (
--         if PBo_Flowmain.dialogbar do (cui.UnRegisterDialogBar PBo_Flowmain ; destroyDialog PBo_Flowmain)
--         createdialog PBo_Flowmain ~PBO_FLOWMAIN_X~ 208 PolyBoost.PBo_Flowmainpos.x PolyBoost.PBo_Flowmainpos.y
--     )
--     else (createdialog PBo_Flowmain ~PBO_FLOWMAIN_X2~ 208 157 344)
--     cui.RegisterDialogBar PBo_Flowmain minSize:~PBO_FLOWMAIN_MIN_SIZE~ maxSize:~PBO_FLOWMAIN_MAX_SIZE~

 

----------

Here you can see how the Loop Tools was looked in PolyBoost. In the code above you can see what AD was removed. :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.