Locinator 2.0


Album of tutorial/example videos

IN ALPHA for pals and cgmOpenDev slack channel(if you wanna join, pm me)

What is Locinator?

It’s a tool for matching objects to locators or other objects as well as creating update-able locators in a myriad of ways.

In early 2017, we undertook a rewrite of cgmLocinator as a part of our new marking menu push and core rewrite. New locator types and a conversion from a traditional ui to a marking menu are a part of this push.

What can I do with it?

  • Track a ball in a characters hand for a short while
  • Snap a foot or hand in world space over time if the rig you’re using doesn’t support space switching
  • Track a mid point
  • Give a character multiple hand hold positions on a staff or other prop to snap to.

How do I use it?

If you have the cgmToolbox installed:

  • cgmToolbox menu>animation>cgm.locinator
    • If you want the old one. menu>legacy>cgm.locinator
  • Python – cgm.core.tools.locinator.ui()
  • Marking menu – self evident on most modes as locinator is key to those modes. See marking menu.

General Concepts

  • Locator modes
    • fromObj — Locator is created that matches it’s source object so that they may be snapped back and forth between them. May be component or transfom
    • midPoint — Midpoint of specified targets. Targets may be transforms or components. If one target is specified, it updates to the boundingbox center of the target, otherwise it updates to the midpoint of the stored targets
    • closestPoint — Closest point on the surface of the targets to the source. Targets may be curves, nurbs or mesh
    • closestTarget — Closest transform or component target to the source
    • rayCast — Created by casting a ray at a surface. Creation data is stored for updating.
    • attachPoint — Ease of use setup for having a match target that tracks another object.
  • Updateable loc — Information is stored on a loc at creation that allows it be recreated.  When you have a loc selected that has been created with locinator you may press Locinator>match and it will update the locator to it’s new position and rotation (if applicable)
  • Source — This is the creation target of a given loc.
  • Matching —   An object may have one cgmMatchTarget. When you create a loc from an object, this relationship is automatically setup. What this means is that if you have an object selected and select Locinator>Match, the object will snap to it’s match target based on your match mode options.
  • Baking — When you want to match either a loc or a source object over time. There are several modes. See below.
  • OptionVar —  OptionVars are a maya preference variable that you can store data to. They are a handy way of storing preferences and options between multiple guis. We use a lot of them.
  • Match Buffer —  Buffers are something we use in most of our uis. They’re a way of specifying objects to do other stuff to without a gui or selection required.
  • Match Mode Options
    • point– Only snap position
    • orient – Only rotation
    • point/orient – both
  • cgmMarkingMenu — Root for this for our purposes. More info here. Abbreviating as cgmMM.

UI

  • Menus
    • Options
      • MatchMode – set the match mode. See above
      • Bake keys
        • loc – use keys of the loc
        • source – use keys of the source
        • combine – combine keys of both
        • frames – every frame in range
        • twos – in range, on twos
        • threes – in range, on threes
      • Tag Selected – Tag all selected objects to the last object as those previous object’s loc
      • Clear Selected – Remove locinator attrs from an object
    • Buffer
      • Define – Whatever is selected will now be the buffer
      • Add Selected – Append to the buffer
      • Remove Selected – ….
      • Report – Report the buffer to the script editor
      • Select Members – Select the buffer
      • Clear – Empty the buffer
    • Help
      • Report Loc Data – If locators or objects with tags are selected, report their data to the script editor
      • Get help – You get here:)
      • Log Self – Something for our tools. Reports data stored to the ui python object.
  • Tabs
    • Update
      • Update
        • Self – Snap the selected objects
        • Target – Snap the match objects/source of those selected. If you have an object selected and do this, it will update the loc to the object and not vice versa
        • Buffer – Snap the buffer objects
      • Bake
        • Slider Range – Push the slider range values to the int fields
        • Scene Range – Push scene range values to the int fields
        • Targets – set bake mode between selection and buffer
        • <<< – Bake within a context of keys in range prior to the current time
        • All – Bake within a context of the entire range of keys
        • >>> – Bake within a context of keys in range after the current time
    • Create
      • See options in the concepts above.

Marking Menu

The marking menu is designed to make most locinator functionality within a single button press.

  • Loc(N) —
    • Selected — Creates a fromObj per object selected. Supports most components.
    • Mid Point — Creates midPoint loc based on selection
    • Closest Point — Creates closestPoint loc with the first object in selection being the source.
    • Closest Target — Creates closestTarget loc with the first object in selection being the source.
    • RayCast — Single on surface loc cast. For more options see the Ray create menu in TD mode or the cgmMarking Menu.
    • AttachPoint — Creates an attach point via rayCast follicle and a fromObj loc to go with it.
    • World Center — self explanatory
  • UI(NW) – Opens the ui
  • Baking
    • Bake Range(NE) —
      • Selected — Selected timeline range
      • Slider— Entire slider
      • Scene— yup.
    • Bake Direction(E) — Directional baking
      • Forward — Bake after current frame
        • Slider— Entire slider
        • Scene— yup.
      • Back — Bake before current frame
        • Slider— Entire slider
        • Scene— yup.
      • Combined — Combine the key indices of both and key on those intervals.
    • Bake by…?(SE) — radial option menu to set keymde
  • Utils(W)
    • Tag to last as cgmMatchTarget — Tag any objects to a locator or another objects as their match targets
    • Clear match target data — removes the attributes used for our purposes
    • Report — gives a rundown on out your selected is seen by the locinator system
    • Help — gets you here!
  • Match(S) 
    • Self — For each item you have selected, will update it if a loc, will match it if it has a cgmMatchTarget
    • Target — For each item you have selected will update their cgmMatchTarget. If that target is a loc, will upate it as such.
    • Buffer — Updates any objects in your buffer. If your buffer is empty, it gave your index finger a bit of exercise.

Specific Help

Match Buffer

Sometimes you wanna update stuff regardless of what you have selected. That’s what the match buffer is for. You can access it via buffers>match where you’ll find several options. More on that in a moment.

  1. Select what you want to buffer to match update
  2. cgmMM>buffers>match>define
  3. select whatever or nothing
  4. cgmMM>snap>match>buffer
  5. Updates buffer objects regardless of selection

The way this buffer works is via an optionVariable in maya which is cool in that it is maintained between maya sessions but not so great as data is stored by strings. With that in mind, let’s look at the rest of the buffer menu items.

  • Define – Define your presently selected objects as the match buffer. It is an ordered list
  • Add Selected – append
  • Remove Selected – remove
  • Report — Reports what’s stored in the script editor
  • Select Members — Select your buffer objects
  • Clear — Wipe the buffer

attachPoint Loc Setup

This is most handy for a fast and dirty snap to point that tracks another surface you want to follow. Like if you wanted a point on a sword or a character’s hip to come back to without a constraint setup.

How might we do this?

  1. Select the control or object you wanna track to a mesh (skinned or not)
  2. cgmMM>Locinator>Loc>Attach Point
  3. A fromObj locator is created and  a rayCast context will begin.
  4. Press your mouse down on the surface you want to attach to and you’ll see a locator start dragging on the surface, when it’s where you wanted it, release.
  5. A follicle will be created at that point and your new loc will be parented to that follicle.

Now, whenever you want to snap to that point, just select your original control and cgmMM>Locinator>Match>Self OR cgmMM>Snap>Match>Self.

You can also bake that tracking over time using the baking menu in Locinator.

Don’ts

  • Don’t loc a skinned object and expect your loc to track. Track a point on that object and you’re fine.
  • more to come…

Plugging into your own marking menu

Need someone to help walk through this. Ping me if interested. The wiring is all there.


 
Creative Commons License

Categories