# Path: pdil/tool/fossil/_core/config.py
# FOSSIL_CTRL_TYPE = 'fossilCtrlType'
# FOSSIL_MAIN_CONTROL = 'fossilMainControl'
# JOINT_SIDE_CODE_MAP = {
#     'left':  _settings['joint_left'],
#     'right': _settings['joint_right'],
#     '': '',
# }
# CONTROL_SIDE_CODE_MAP = {
#     'left': _settings['control_left'],
#     'right': _settings['control_right'],
#     '': '',
# }
# def otherSideCode(name):
# def jointSideSuffix(code):
# def controlSideSuffix(code):
# 
# Path: pdil/tool/fossil/_core/find.py
# def rootBone(nodes=None):
# def controllers(main=None):
# def mainGroup(nodePool=None, fromControl=None):
# def mainGroups():
# def rootMotion(main=None):
# def blueprintCards(skeletonBlueprint=None):
#     def order(obj):
# def cardJointBuildOrder():
# def cardHierarchy():
#     def gatherChildren(cards):


from pymel.core import curve, group, hide, joint, ls, objExists, parentConstraint, pointConstraint, PyNode
from ._core import config
from ._core import find
import pdil
from __future__ import absolute_import, division, print_function




def mainGroup(create=True, nodes=None):
    main = find.mainGroup()
    
    if main:
        return main
    
    if create:
        # Draw outer arrow shape
        main = curve( name='main', d=True, p=[(-40, 0, 20 ), (0, 0, 60 ), (40, 0, 20 ), (40, 0, -40 ), (0, 0, -20 ), (-40, 0, -40 ), (-40, 0, 20 )] )
        pdil.dagObj.lock(main, 's')
        main.visibility.setKeyable(False)
        main.visibility.set(cb=True)
    
        tagAsMain(main)
        
        if True:  # Put it in a default group
            pdil.layer.putInLayer(main, 'Controls')
        return main
    
    return None


def tagAsMain(obj):
    ''' Adds markup to identify the given object as the main control group.
    '''

# Path: pdil/tool/fossil/_core/config.py
# FOSSIL_CTRL_TYPE = 'fossilCtrlType'
# FOSSIL_MAIN_CONTROL = 'fossilMainControl'
# JOINT_SIDE_CODE_MAP = {
#     'left':  _settings['joint_left'],
#     'right': _settings['joint_right'],
#     '': '',
# }
# CONTROL_SIDE_CODE_MAP = {
#     'left': _settings['control_left'],
#     'right': _settings['control_right'],
#     '': '',
# }
# def otherSideCode(name):
# def jointSideSuffix(code):
# def controlSideSuffix(code):
# 
# Path: pdil/tool/fossil/_core/find.py
# def rootBone(nodes=None):
# def controllers(main=None):
# def mainGroup(nodePool=None, fromControl=None):
# def mainGroups():
# def rootMotion(main=None):
# def blueprintCards(skeletonBlueprint=None):
#     def order(obj):
# def cardJointBuildOrder():
# def cardHierarchy():
#     def gatherChildren(cards):


# Path: pdil/tool/fossil/node.py
from pymel.core import curve, group, hide, joint, ls, objExists, parentConstraint, pointConstraint, PyNode
from ._core import config
from ._core import find
import pdil

from __future__ import absolute_import, division, print_function




def mainGroup(create=True, nodes=None):
    main = find.mainGroup()
    
    if main:
        return main
    
    if create:
        # Draw outer arrow shape
        main = curve( name='main', d=True, p=[(-40, 0, 20 ), (0, 0, 60 ), (40, 0, 20 ), (40, 0, -40 ), (0, 0, -20 ), (-40, 0, -40 ), (-40, 0, 20 )] )
        pdil.dagObj.lock(main, 's')
        main.visibility.setKeyable(False)
        main.visibility.set(cb=True)
    
        tagAsMain(main)
        
        if True:  # Put it in a default group
            pdil.layer.putInLayer(main, 'Controls')
        return main
    
    return None


def tagAsMain(obj):
    ''' Adds markup to identify the given object as the main control group.
    '''

    obj.addAttr(config.FOSSIL_MAIN_CONTROL, at='message')