Earlier I posted this one.
Unfortunately, my hard drive died the other day and lost my script(s).. Anyhow the script I previously wrote had a disadvantage that renamed images could never be ordered ordered based on time taken. It ordered images based on date taken but the number suffix at end was not too accurate to be able to order them as I wanted.
So I rewrote the script. This is what it does now. Instead of giving images number suffix, I decided to give each image an unique number by adding hour-minute-second eg)062534 means that the image was taken at 6am 25mins 34 seconds.
Note! Time in my camera was like 8 hours early! So that’s why the photo in the screenshot above was taken like at 2am! We were sleeping then! I have corrected time in my camera now.
Download:
http://daisukemaki.com/scripts/renameBasedOnDatesTaken.py
Usage:
- requires EXIF.py in the same directory as this script
- in shell type, renameBasedOnDatesTaken.py soccer
Image in the directory will be renamed to like this
2009-12-20.123454.soccer.JPG
2009-12-20.123625.soccer.JPG
I was bored.. The script will extrude faces when you run a command with arguments while selecting a polygon after running the script.
Usage:
1. select a polygon then run the script
2. you can type in the following in python, faceExtrude(1,200,1)
faceExtrude(1,200,1) # first argument is first frame, 2nd is the end frame then the 3rd is how much of total faces should be extruding in each frame. Value of 1 is max.(1 = 100%)

import maya.cmds as cmds
#cmds.polyExtrudeFacet( 'pCube1.f[1:2]', 'pCube1.f[3:4]', kft=False, ltz=2, ls=(.5, .5, 0) )
# what percentage?, for how many frames
def faceExtrude (minTime, maxTime, ratio):
if ratio > 1:
print "Warning: please keep the 3rd argument to be smaller than 1.0"
else:
mySel = cmds.ls(sl=True)
for fr in range(minTime, maxTime):
cmds.currentTime(fr, edit=True )
faceToVertex = cmds.polyInfo(mySel[0],faceToVertex=True)
faceCount = len(faceToVertex)
print (str(faceCount)+' faceCount')
faceExtrudeCount = int(faceCount * ratio) # number of faces that will be extruded
print (str(faceExtrudeCount)+' faceExtrudeCount')
faceExtrudeCountInc = 0
while faceExtrudeCountInc < faceCount:
faceExtrudeCountInc += faceExtrudeCount
faceExtrudeCountExtra = faceExtrudeCountInc + 1
print (str(faceExtrudeCountInc)+' faceExtrudeCountInc')
test = (mySel[0]+'.f['+str(faceExtrudeCountInc)+':'+str(faceExtrudeCountExtra)+']')
#cmds.polyExtrudeFacet( test, kft=False, ltz=2, ls=(.9, .9, 0) )
cmds.polyExtrudeFacet( test, kft=False, ltz=10, ls=(.3, .3, 0) )
I have updated my renameNum.py script so that the script now renames photos based on the date the photo was taken as well as the same arguments typed in.
Thanks to people who coded EXIF.py, and it made a lot easier to fetch the data from the metadata of the photo.

props:
I photoshop’d a photo and saved it today, but the script correctly renamed the photo with a date taken!
conspiracy:
currently it renames files in random order thus the last 3 digit numbers are not exactly in right order.
This script renames photos in the directory the script was run.
rename myNewName 1
rename is an alias I used to call the python script. Other 2 are arguments. 1st argument is how you want to call new files, then the 2nd one is which number you want to use as a start number. eg) if the second argument is 16 the first file will be named 016..017..018.

By default I made it so the numeber has 3 digits.
I have been learning python for maya for a while now.. I decided to step out of maya and start writing meaningless scripts for just fun outside maya.
This simple script can be a simple calculator.
Typing below in Konsole shell will give a result of 2 divided by 3
calc 25 / 3
result: 8.33333333333
calc is basically an alias I assigned to source my python script then the rest are arguments.
This script can handle +, -, x, /, % and **(square).
