Home Technical Talk

cly_pivotReflectionModeling.mel

polycounter lvl 10
Offline / Send Message
claydough polycounter lvl 10
3202650007_2dd4938879_o.png
Edit: updated because Logic Error is embarrasing and the
"then don't do that" fix was getting old.
clay_pivotreflect.jpg version 2.0.5 download <--
multiple bug fixes:

the userSetup.mel code to re-establish shelfButton popUp menus failed if the tablayout was not visible.
( the `lsUI` control search would fail )

multiple fixes for multiple objects with matching names failure:
( variable for object failed to be recognized when there were copies matching the
same name in different paths.
// Error: file: %%/cly_pivotReflectionModeling.mel line 841: No object matches name: |pCube1 // )

symmetry utilities would "break;" without resetting orientaion offset and original parent.
cly_pivotReflectionModeling.mel.v.2.0.5
3202650007_2dd4938879_o.png
cly_pivotReflectionModeling.mel is a Maya symmetry solution that
mirrors ( or auto-mirrors ) based on pivot location.

with the auto mirror scriptJob running... Maya's tools and actions are all reflected after every edit.
( like a negatively scaled instance but without the hard seam or set-up hassle )

USAGE:
This script requires user to follow such a werkflow as:

Optionally, run cly_pivotReflectionModelingPrefs.mel to set preferences. then...
Simply Modify -> center pivot or...
Hit yer insert key and interactively place each mesh's pivot. or..
Do nothing ( yer pivot was peachy to begin with ) and
Execute this script cly_pivotReflectionModeling to mirror across the pivot position.
The script automates deletion of half yer model,
mirrors yer object, mirroring edits
and history across the pivot axis ( reflected extrudes, polysplits etc...)

Stray vertices @ the origin are cleaned "centered".
( dependent on the "Origin Straighten Threshold" in cly_pivotReflectionModelingPrefs.mel )

Holes outside the merge threshold are preserved.

If present, edge smoothing at the origin loop is preserved.

if cly_autoMirrorScriptJob.mel's scriptJob UI is running then mirroing is automated on any object after each edit.
( any poly mesh with focus is auto mirrored )


ASSUMES USER HAS AN ORIGIN EDGELOOP ( "SAVE FOR MINI-MISTAKES WITHIN THE CORRECTIVE THRESHOLD SET IN
PREFERENCES" ) THAT IS ALIGNED STRAIGHT WITH THE AXIS OF THEIR PREFERENCE.

Known Issues:
Edge Extrudes will fail if "along" the origin edge loop. ( don't do that )
edge extrudes intersecting ( T ) and even crossing ( + ) the origin are fine.

T and + actually provide for different extrude functionaity for both edges and faces
( extruded together or extuded apart )

3284079475_86a4c44ac6.jpg



I'll try to post a video capture of an example workflow later.
If not, with the setUp option... a shelfButton is created overloaded with a
popUp menu that will get u to all the features under the hood.

Replies

  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    very cool man, i was thinking of doing something like this, yer beat me to it!
    good stuff.
  • renderhjs
    Options
    Offline / Send Message
    renderhjs sublime tool
    autodesk should add the modifier concept of 3dsmax to maya - I can imagine that you script works well but still I would feel abit uncomfortable having to run a script constantly in the background.
    The GUI could use some simplicity
  • pior
    Options
    Offline / Send Message
    pior grand marshal polycounter
    I find it great that you pulled this off!!! Will try it first thing tomorrow and give you feedback. It's so weird that Maya's symetry feature works only on selections and transformations, not on edits hehe.

    And I'm so baffled at the same time. How come that in this day, Maya still lacks that by default. Crazy shitty development team. I'm tired of ducttaping the app to make it useable.
  • claydough
    Options
    Offline / Send Message
    claydough polycounter lvl 10
    renderhjs wrote: »
    autodesk should add the modifier concept of 3dsmax to maya - I can imagine that you script works well but still I would feel abit uncomfortable having to run a script constantly in the background.
    The GUI could use some simplicity

    The GUI is a shelf Button overloaded with a popUp menu? Do you mean the preferences window?

    That popUp menu can be auto assigned to any control in maya simply by annotating it thusly:
    -annotation "a collection of cly_pivotReflectionModeling symmetry tools"
    

    rebuild of the shelfButton UI is achieved with the userSetup.mel code located in the download.


    The scriptJuob status window can be minimized by right-clicking the titlebar.

    There is a scriptJob concerns thread worth noting @ tao

    For hotkeys and marking menus the following 3 commands are all that is really necessary:
    cly_pivotReflectionModeling
    cly_pivotReflectionModelingPrefs
    cly_autoMirrorScriptJob

  • claydough
    Options
    Offline / Send Message
    claydough polycounter lvl 10
    Updated "version 2.0.2"
    version 2.0.2 includes new menus for additional symmetry utilities and
    a fix for softSelect corruption of mirrors
    download: here




    .
  • claydough
    Options
    Offline / Send Message
    claydough polycounter lvl 10
    3202650007_2dd4938879_o.png
    Edit: updated because Logic Error is embarrasing and the
    "then don't do that" fix was getting old.
    clay_pivotreflect.jpg version 2.0.5 download <--
    multiple bug fixes:

    the userSetup.mel code to re-establish shelfButton popUp menus failed if the tablayout was not visible.
    ( the `lsUI` control search would fail )

    multiple fixes for multiple objects with matching names failure:
    ( variable for object failed to be recognized when there were copies matching the
    same name in different paths.
    // Error: file: %%/cly_pivotReflectionModeling.mel line 841: No object matches name: |pCube1 // )

    symmetry utilities would "break;" without resetting orientaion offset and original parent.
    cly_pivotReflectionModeling.mel.v.2.0.5
    3202650007_2dd4938879_o.png


    3270869354_1133a187fd_o.jpg
  • elte
    Options
    Offline / Send Message
    elte polycounter lvl 18
    Roger, updated ur script to latest version, follow all the instructions, and I got this (maya 2011)

    cly_pivotReflectionModeling;
    // Error: Number of arguments on call to cly_pivotReflectionModeling does not match number of parameters in procedure definition. //
  • claydough
    Options
    Offline / Send Message
    claydough polycounter lvl 10
    elte wrote: »
    Roger, updated ur script to latest version, follow all the instructions, and I got this (maya 2011)

    cly_pivotReflectionModeling;
    // Error: Number of arguments on call to cly_pivotReflectionModeling does not match number of parameters in procedure definition. //

    Sorry I missed yer post,
    The command did not work because an argument was not specified.
    see the list of commands below with a description of argument features.

    On the other hand, The shelfButton popUp menu GUI should work fine in maya 2011 and setup in a current shelfLayout would be installed with the following installation procedure:
    INSTALLATION:
    1. place the following scripts in your scripts folder:
    ( cly_autoMirrorScriptJob.mel, cly_pivotReflectionModelingPrefs.mel, cly_getDistance.mel, cly_pivotReflectionModeling.mel, cly_pipelineUtilities.mel,
    cly_reflectionMenus.mel, cly_pivotReflectionModelingSetup.mel ) replacing old version if necessary.
    2. place following icons in your icons folder:
    ( clay_pivotReflect.bmp, cly_getDistance.bmp, cly_autoMirrorScriptJob.bmp )
    3. add contents within userSetup.txt to the contents of your userSetup.mel
    if no userSetup.mel exists in your scripts directories... then
    simply rename userSetup.txt to userSetup.mel and place that in your
    scripts directory instead.
    4. restart Maya
    5. from the command line, run this script:
    cly_pivotReflectionModelingSetup
    6. With a model selected or hilited... click the shelfButton to mirror ( default is -x direction )
    or right click the shelf button for a popUpMenu with more options
    ( without the proper setup of userSetup.mel this overloaded
    shelfButton will fail to rebuild between sessions )

    The following commands will implement most features.
    Also these commands would be relevant to Maya 2012 as the new popup menu feature eventually kills the shelfButton menu installed with the previous setup.

    [php]
    cly_pivotReflectionModeling 2;
    // to select symmetry from selection's mesh

    cly_pivotReflectionModeling 3;
    // to delect symmetry from selection's mesh

    cly_pivotReflectionModeling 1;
    // to mirror the current mesh
    /* The script automates deletion of half yer model,
    mirrors yer object, mirroring edits
    and history across the pivot axis ( reflected extrudes, polysplits etc...)

    Stray vertices @ the origin are cleaned "centered".
    ( dependent on the "Origin Straighten Threshold" in cly_pivotReflectionModelingPrefs.mel )

    Holes outside the merge threshold are preserved.

    If present, edge smoothing at the origin loop is preserved.
    */

    cly_pivotReflectionModelingPrefs;
    // to open user preference option window.

    cly_autoMirrorScriptJob;
    // The Beef! opens the scriptJob UI. mirroring is automated on any object after every edit!
    //When the Ui or the scene is closed the Automated reflection job ends.
    [/php]
    cly_pivotReflectionModeling.mel v 2.0.5b
    On a polygon model...
    auto delete, mirror, and clean the origin edgeloop along a user defined axis ( -x by default ).
    ( settings via cly_pivotReflectionModelingPrefs.mel )

    Roger Klado was here
    because no one else will do it fer me
    March 20, 2010 ( some symmetry utilities )
    RogerKlado@gmail.com ( Klado/Claydough/cly_ )
    __________________________________________________________________________________________________________
    REQUIREMENTS:
    REQUIRES cly_pipelineUtilities.mel to werk properly.
    ( cly_autoMirrorScriptJob.mel, cly_pivotReflectionModelingPrefs.mel, cly_getDistance.mel,
    cly_reflectionMenus.mel, cly_pivotReflectionModelingSetup for added functionality )

    ASSUMES POLYGON MODELING
    ASSUMES poly Constraints may be disabled after script execution ( To Do: polySelectConstraint query. -stateString )
    ASSUMES THIS SCRIPT AUTOMATES THE DELETION OF HALF THE MODEL
    ( the script will still mirror if user presents half a model beforehand, )
    ASSUMES HOLES OUTSIDE THE ORIGIN ARE TO BE PRESERVED
    ASSUMES USER HAS AN ORIGIN EDGELOOP ( "SAVE FOR MINI-MISTAKES WITHIN THE CORRECTIVE THRESHOLD SET IN
    PREFERENCES" ) THAT IS ALIGNED STRAIGHT WITH THE AXIS OF THEIR PREFERENCE.
    ASSUMES origin loop VERTICES MAY BE MERGED ( 0.1 threshold by default settings via cly_pivotReflectionModelingPrefs.mel )
    ASSUMES inherits transform enabled to set orientation for orientation offset option
    ASSUMES an Undo Queue is present

    Known Issues:
    Extrude Edge BORDER EDGES on the origin may fail to calculate predictably.( Lamina and/or merged into itself on the origin )
    When using the cly_autoMirror script job...
    If applying Maya's "Duplicate Faces" or "Extract"...
    then uncheck the "seperate duplicated faces" option. If Extract, uncheck the "seperate extracted faces" option.
    likewise... Applying "Seperate" to a face while in cly_autoMirrorScriptJob is running will fail to execute predictably.
    no solution for mirrored creases

    UV's are mirrored. UV transfer nodes will be broken after mirror. ( save a duplicate mesh before any mirroring to restore by transfer later )

    // With the automated scriptJob... slide edges tool and TransformComponent will not
    // automatically mirror after completion but will update fine with subsequent poly
    // action or a manually executed cly_pivotReflectionModeling command.

    __________________________________________________________________________________________________________
    This script uses a combination of an objects object space and world space pivot position to git the mirror origin.
    ( "object pivot" not bounding box extent or "face component selection pivot" ( Maya Mirror Geometry's default behavior ) )

    __________________________________________________________________________________________________________
    USAGE:
    This script requires user to follow such a werkflow as:

    Optionally, run cly_pivotReflectionModelingPrefs.mel to set preferences. then...
    Simply Modify -> center pivot or...
    Hit yer insert key and interactively place each shape's pivot. or..
    Do nothing ( yer pivot was peachy to begin with ) and
    Execute this script cly_pivotReflectionModeling to mirror across the pivot position.
    The script automates deletion of half yer model,
    mirrors yer object, mirroring edits
    and history across the pivot axis ( reflected extrudes, polysplits etc...)

    Stray vertices @ the origin are cleaned "centered".
    ( dependent on the "Origin Straighten Threshold" in cly_pivotReflectionModelingPrefs.mel )

    Holes outside the merge threshold are preserved.

    With cly_pivotReflectionModelingPrefs.mel's...
    "connect with holes option" ( Maya's Mirror Geometry "Connect Border Edges" option )
    ( holes and edge extrudes are preseved and extra geometry created by polyMirrorFace's
    connect attribute are hidden. inside a polyMerge node
    ( connecting geometry is exposed via polyMirrorFace's axis attrs ))
    ( only the origin loop border edges within cly_pivotReflectionModelingPrefs.mel's
    hole threshold is connected )

    If present, edge smoothing at the origin loop is preserved.

    if cly_autoMirrorScriptJob.mel's scriptJob UI is running then mirroring is automated on any object after each edit
    _________________________________________________________________________________________________________
Sign In or Register to comment.