I will be adding actual code under this category … be warned, even though i will try to invent a new wheel, it will take some time probably :). You can grab the script at the end of the post.
This type of script exist for like forever, the only different thing is that ive used vectors to do it, mainly subtraction and scaling of vectors:


#get the joints positions and convert to MVectors
strJntRaw = cmds.xform(startJnt,ws=True,q=True,t=True)
strJntPos = om.MVector(strJntRaw[0], strJntRaw[1], strJntRaw[2])

endJntRaw = cmds.xform(jntChild[0],ws=True,q=True,t=True)
endJntPos = om.MVector(endJntRaw[0], endJntRaw[1], endJntRaw[2])

#subtracting vectors in order to get to the segments position
subJnt = endJntPos - strJntPos

for i in range(1,int(numSegments)):
      newJntPos = subJnt * i * (1/numSegments) + strJntPos

Also, Ive tried to check for the proper orient rotation ( aka the child joint was not moved with Insert and has translation in only one axis) using vectors, specifically getting the norm vector of the child and checking to see if it has 1 on one of the axis. This is done in local space ( it would not work in world).


endJntRaw = cmds.xform(endJoint,q=True,t=True)
endJntPos = om.MVector(endJntRaw[0], endJntRaw[1], endJntRaw[2])
downAxis = ''
endJntNorm = endJntPos.normal()
for i in range(0,3):

if endJntNorm[i] == 1:
       if i==0:
           downAxis = 'x'
           print 'its x'
       elif i==1:
           downAxis = 'y'
           print 'its y'
       elif i==2:
           downAxis = 'z'
           print 'its z'
return downAxis

Download bdSplitJoint.py

Software:
Maya, QT Designer

Scripting Language:
Python

what it does:
– renames multiple objects using an index based convention

how it does:
– the user needs to select at least one object
– a mask is required for the renaming, with a choice of prefix and suffix too.
– by default the index is 2 digits based ( as in starts counting from 00 to 99). Should the selected object be over 100, automatically 3 digits are used. I assume nobody wants to rename 1000+ objects
– UI is built using QT Designer, but all the events are added in Maya
– the function used to retrieve the widgets paths was written by Chris G.

bdMultiRename from Bogdan Diaconu on Vimeo.

Software:
Softimage

Scripting Language:
Python

what it does:
– keeps track of all the weapon files ( rig files, model files, 1st person view and 3rd person view animation files ) for a FPS type of game

how it does:
– reads the weapon list from an XML file
– based on the above, creates all the paths needed to grab the file names
– uses several filters: character, weapon type, file type
– based on the filters, displays all the files sorted by date ( the most recent on top of the list)

video:

bdWeaponAdmin from Bogdan Diaconu on Vimeo.

Software:
Softimage

Scripting Language:
Python

what it does:
– setups everything needed in regards to adding a new weapon in a FPS type of game

how it does:
– creates the weapon project ( Softimage)
– creates the folder structure for the weapon: the one for the weapon rig, the one for the 1st person view animation of and the one of the 3rd person view animation
– adds the weapon to the XML file that keeps the weapon list
– imports all the weapon parts as obj’s and assigns individual shaders per part
– forces a naming convention
– creates the general skeleton for a weapon and skins the dynamic meshes to those
 

bdWeaponUtils from Bogdan Diaconu on Vimeo.

Software:
Softimage

Scripting Language:
Python

what it does:
– saves poses using XML files

how it does:
– on the first run the user has to setup a global path for the poses and to add characters
– those above will be saved as user preference and automatically used upon new runs. They can also be modified and the preferences will be updated
– with a character open, the user will have to select the desired controllers
– when the pose is saved, the plugin creates a XML file to store the pose, a synoptic file ( basically an HTML file) that holds the ‘image button’ for the pose and finally a thumbnail preview used in the synoptic file.
– updates the UI with the created pose

PS. Was slightly painful to code the UI due to the dynamic refreshing of it. Also, saving the preferences using softimage’s preferences system is not really friendly, proabably would have been better to save them as an XML file too. Maybe in another iteration

bdPoseLibrary from Bogdan Diaconu on Vimeo.

© 2017 Moving Pixels Suffusion theme by Sayontan Sinha