RdM_Script_Tools

RDM_SCRIPT_TOOLS are my new rigging script tools. This is in progress right now and I’m sure I will sell them after I finished them, but I need to try them so if you want to use them let me know and I can email them to you.

I create this website a temporary documentation page so I don’t lose myself self and if anybody tests them they have some sort of guide. I’ll try my best to have everything update here so it’s really easy to follow.

I hope you like them and don’t be shy and write me if you want to try them too, just be careful because they are changing constantly so if you do something maybe in the next version you may need to update one or to lines of code for it to work. the idea is to make scripting easy for all of us! Sorry if I had bad spelling but I’m doing this fast and my main language is Spanish so I’m not really concerned about the spelling in this doc for now.

To intall them just copy and paste the folder RdM_ScriptTools in  Documents\maya\201X\scripts\RdM_ScriptTools

 

To start using them your first code should be this ones:

import RdM_ScriptTools

from RdM_ScriptTools import main_rdm

reload(RdM_ScriptTools.main_rdm)

 

rdm = main_rdm.RdM()

rdm.FUNC(ARGUMENTS)

NAME CONVENTIONS

All the name spaces are defined in a json file so we are able to change them if we use the tools in one or another studio. They are already in the tools but if you want to use the name conventions you need to use this code at the start also 

PATH = WHERE THE JSON FILE IS
JSON_FILE = (PATH + ‘/NameConventions.json’)
with open(JSON_FILE) as json_file:
    nc = json.load(json_file)

you can call the namespace with: nc[‘joint’] if you want the joint one. All the avilable ones are: 
“left”: “L_”,
“right”: “R_”,
“joint_end”: “_JntEnd”,
“joint_bind”: “_Bnd”,
“group”: “_Grp”,
“ctrl”: “_Ctrl”,
“locator”: “_Loc”,
“nurb”: “_Nurb”,
“ik_sc” : “_IKsc”
“joint”: “_Jnt”,
“geo”: “_Geo”,
“follicle”: “_Fol”,
“ik_rp” : “_IKrp”,


Example: 
if you want to create a joint using the name space as sufix
jnt= cmds.joint(n = ‘name_{ }’.format(nc[‘joint’])) 
The result will be: name_Jnt

 

TOOLS

root_grp

root_grp( input = ”, custom = False, custom_name = ‘customName’, autoRoot = False, replace_nc = False)

This allow you to create an offset group over your input. Input can be selection in the viewport os argument input ‘object here’. def r

Available arguments:
input = the object to create a group to zero translation and rotation
custom = if you want a custom name you should put this argument in True, its False by default
custom_name =’the name that you want to have over the selection
autoRoot = True if you want to have 2 group create over the selection with name input_auto and then another input_root 
replace_nc = true if you want to try to automatically change some namespaces 

this will return the new groups as a list

replace_name

replace_name(input = ”, search = ”, replace = ”, hi = False):

search and replace names with the input, input can be viewport selection or a string in the code

Available arguments:
input: the object to be rename
search: the string to be repalced
replace: the new string
hi: true if you want to check the hierarchy of the input


This will return the object with the new name

asign_color

asign_color( input = ”, color = ‘lightBlue’):

easy asing color to your curves.

Available Colors:

‘red’
‘blue’
‘white’
‘purple’
‘green’
‘lightBlue’
‘yellow’
‘grey’

Available arguments:
input = the object to asign a new color

Color: The color you want as a string, check available colors

hide_attr

hide_attr( input = ”, t= False, r = False, s = False, v = False, show = False)

Hide attributes from input, you can hide translate, rotate, scale, or visibility. the show will show them all at the same time.

Available arguments:
 input = ”
t= hide translte
r = hide rotate
s = hide scale
v = hide visibility
 show = show all

curve

curve( type = ‘cube’, rename = False, custom_name = False, name = ”, size = 1)

Available Curves (all in curves.json):
cube, sphere, square, pringle, feet, hand, circleX, circle, circleZ

Available arguments:
type = ‘cube’ if you want a cube, use the names above and select the desire one
rename = true if you want to use the selected object as name + nameConvention else it will use type + name convention
custom_name = True if you want to decide the new name completly
name =  the new name to be asigned
size = the size of the controller

this will return the new curve transform

 

match

match( this = ”, that = ” ,t = True, r = True, s = True)easy asing color to your curves.

Match transformations between 2 objects, this and that

Available arguments:
this: object to modify
that: object to match
t = True if you want to match translate
r = True if you want to match rotate
s = True if you want to match sacle

switch_constraints

switch_constraints(this = ”, that = ”, main = ”, attr = ”)

create a switch of 2 chains and a main (ik, fk, main for example), this one use a parent and scale constraint, we also have the rdm.switch_blend_colors for another option

Available arguments:
this = firts transform to be added as option
that = second transform to be added as option
main = transform to be controled by any of this transforms
attr = where is the switch going to be?
 
 this will return:  none

example:
rdm.switch_constraints(this = ‘joint2’, that = ‘joint3’, main = ‘joint1’, attr = ‘locator1.switch’)

 

switch_blend_colors

switch_constraints(this = ”, that = ”, main = ”, attr = ”)

create a switch of 2 chains and a main (ik, fk, main for example), this one use a blend colors node, we also have the rdm.switch_constraints for another option

Available arguments:
this = firts transform to be added as option
that = second transform to be added as option
main = transform to be controled by any of this transforms
attr = where is the switch going to be?

 this will return:  none

example:
rdm.switch_blend_colors(this = ‘joint2’, that = ‘joint3’, main = ‘joint1’, attr = ‘locator1.switch’)
 

 

new_attr

new_attr( input= ”, name = ‘switch’, min = 0 , max = 1, default = 0):

Add an double  atribbute based on input

Available arguments:
input= transform to add the attr
name = attrbiute name
min = min value
max = max value
default = default value

 this will return: ‘{}.{}’.format(input, name)


example: 
rdm.new_attr(input = ‘locator1’, name = ‘switch’)
 

new_enum

new_attr( input= ”, name = ‘switch’, min = 0 , max = 1, default = 0):

Create a new enum attribute, by default it will create a hide show becouse is the most used 

Available arguments:
input= transform to add the attr
name = attrbiute name
min = min value
max = max value
default = default value

 this will return: ‘{}.{}’.format(input, name)

example: 
rdm.new_enum(input = ‘locator1’, name = ‘object’)

duplicate_change_names

duplicate_change_names( input = ”, hi = True, search=’_Jnt’, replace =’_dup’)

Available arguments:

 this will return:  a list with the new names

example: 

 

rdm.duplicate_change_names( input = ”, hi = True, search=’Jnt’, replace =’ik’)

 

KINEMATICS

fk_chain

fk_chain(size = 1, color = ‘lightBlue’, curve_type = ‘circleX’)

Available arguments:

 

 this will return: fk_controllers

pole_vector

pole_vector(bone_one = ”, bone_two = ”, bone_three = ”)

Available arguments:

 

 this will return:  loc with correct PV position

simple_ik_chain

ik_chain( start = ”, end = ”, size = 1, color = ‘lightBlue’, curve_type = ‘cube’, pv = True)

Available arguments:

 

 this will return:  ik_system list

example:

rdm.simple_ik_chain(start = ‘joint_ik_01′, end = ”joint_ik_03’, size = 3, color = ‘lightBlue’, curve_type = ‘cube’)

joints_middle

joints_middle( start = ”, end = ”, axis = ‘X’, amount = 4)

Available arguments:

 

 this will return:  twist in the middle

twist

twist( start = ”, end = ”, axis = ‘X’, amount = 4, mode = ‘down’):

Available arguments:


 this will return:  twist joints

example:

rdm.twist(start = ‘joint1’, end = ‘joint2’, axis = ‘X’, amount = 10, mode = ‘down’)

simple_fk_ik

Available arguments:

 

 this will return: 

Adblock Detected!

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.