Stumbling Toward 'Awesomeness'

A Technical Art Blog

Sunday, October 26, 2008

Weekend Python Snippet- IsItThere.py (Pt. 2)

So, before we looked at just outputting a list of the files that were on device1 and not device2, now I will copy the files to a folder on the main device.

The tricky thing about this is I want the directory structure intact. After looking as os.path, and pywin32, I didn’t see anything like ‘mkdir’ where it would make all the folders deep needed to recreate the branch that a file was in. I did however find a function online:

def mkdir(newdir):
    if os.path.isdir(newdir):
        pass
    elif os.path.isfile(newdir):
        raise OSError("a file with the same name as the desired " \
                      "dir, '%s', already exists." % newdir)
    else:
        head, tail = os.path.split(newdir)
        if head and not os.path.isdir(head):
            mkdir(head)
        if tail:
            os.mkdir(newdir)

To copy the files and create the directories, I altered the previous script a bit:

for (path, dirs, files) in os.walk(path2):
	for file in files:
		if os.path.basename(file) not in filenames:
			newPath = os.path.abspath(os.path.join(path,file)).replace(path2,(path1 + 'isItThere//'))
			fileFull = os.path.abspath(os.path.join(path,file))
			print fileFull + " not found in " + path1 + " file cloud"
			print "Copying " + fileFull + " >>> " + newPath
			if os.path.isdir(os.path.dirname(newPath)) == False:
				mkdir(os.path.dirname(newPath))
			win32file.CopyFile (fileFull, newPath, 0))

The results printed should look like below, the files should have been copied accordingly and the directories created.

U:\photos\Crystal\Orlando - Lauras wedding\P0003270.jpg not found in D:\photos\Crystal\ file cloud
Copying U:\photos\Crystal\Orlando - Lauras wedding\P0003270.jpg >>> D:\photos\Crystal\isItThere\Orlando - Lauras wedding\P0003270.jpg
U:\photos\Crystal\Orlando - Lauras wedding\P0003271.jpg not found in D:\photos\Crystal\ file cloud
Copying U:\photos\Crystal\Orlando - Lauras wedding\P0003271.jpg >>> D:\photos\Crystal\isItThere\Orlando - Lauras wedding\P0003271.jpg
U:\photos\Crystal\Orlando - Lauras wedding\P0003272.jpg not found in D:\photos\Crystal\ file cloud

If I had time, or perhaps when I have time, I’ll add MD5 checks.

posted by Chris at 2:54 PM  

Saturday, October 25, 2008

Weekend Python Snippet- IsItThere.py (Pt. 1)

I am anal-retentive about data retention. There, I said it. There are many times when I find myself in the situation of having two storage devices, that may or may not have duplicate files. I then want to erase one, but do I have all those files backed up?

I use two existing programs to aid me in my anal-retentivity: TerraCopy and WinMerge. Terracopy replaces the windows default copy with something much better (can hash check files when they are copied, etc). With WinMerge, I can right click a folder and say ‘Compare To…’ then right click another and say ‘Compare’. This tells me any differences between the two file/folder trees.

However, here’s an example I have not yet found a good solution for:

I want to erase a camera card I have, I am pretty certain I copied the images off –but how can I be sure! I took those images and sorted them into folders by location or date taken.

So I wrote a small and I am sure inefficient python script to help:

import os
 
filenames = []
 
i = 1
 
path1 = 'D://photos//south america//'
path2 = 'N://DCIM//100ND300//'
 
if os.path.isdir(path1):
	if os.path.isdir(path2):
		print "creating index.."
 
for (path, dirs, files) in os.walk(path1):
	for file in files:
		filenames.append(os.path.basename(file))
 
for (path, dirs, files) in os.walk(path2):
	for file in files:
		if os.path.basename(file) not in filenames:
			print os.path.abspath(os.path.join(path,file)) + ' not found in ' + path1 + ' file cloud'

This will print something like this:

N:/DCIM/100ND300/image.NEF not found in D:/photos/south america/ file cloud

I don’t use python that often at all, please lemme know if there’s a better way to be doing this.

posted by Chris at 6:01 PM  

Friday, October 24, 2008

Autodesk Acquires Softimage for 35 Million

Really? Wow, I mean this isn’t as surprising as when they bought Alias 3 years ago (182 Million), but still. And 35 million? That’s the price of a single movie or three year videogame production these days. I thought the ‘desk bought Maya to kill it, but it’s still around… Wonder how long XSI will be around now.

http://usa.autodesk.com/adsk/servlet/item?id=12022457&siteID=123112

Maybe they will merge all three teams into one highly experienced, ‘all-star’ development team to make a new 3d app to end all 3d apps.

Aren’t there laws about these kinds of monopolies? Looks like the Lightwave and C43D guys are your only alternative..

One less booth at SIGGRAPH..

posted by Chris at 12:50 PM  

Sunday, October 19, 2008

Epic Pipeline Presentation

I saw this presentation about a year ago, talking about the pipeline Epic uses on their games. Maybe some interesting stuff for others here. The images are larger, you can right click -> view image to see a larger version.

45 days or more to create a single character… wow.

They don’t use polycruncher to generate LODs, they do this by hand. They just use it to import the mesh into max in a usable form from mudbox/zbrush.

They don’t care so much about intersecting meshes when making the high res, as it’s just used to derive the nMap, not RP a statue or anything.

They said they only use DeepUV for it’s ‘relax’ feature. They make extensive use of the 3DS Max ‘render to texture’ as well.

Their UT07 characters are highly customizable. Individual armor parts can be added or removed, or even modded. Their UV maps are broken down into set sections that can be generated on the fly. So there are still 2×2048 maps but all the maps can be very different. This is something I have also seen in WoW and other games.

They mentioned many times how they use COLLADA heavily to go between DCC apps.

They share a lot of common components accross characters

posted by Chris at 4:44 PM  

Powered by WordPress