Top Banner
30

The Make Art Button: Batches, Actions and Scripts

Jan 02, 2016

Download

Documents

balthasar-lali

The Make Art Button: Batches, Actions and Scripts. Adrian Woods Technical Art Lead ACES games group Microsoft Game Studios. Who am I?. Technical art lead for ACES games group at Microsoft (Flight Simulator, Train Simulator, Etc.) Managed assets for the entire world! Thousands of models. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: The Make Art Button: Batches, Actions and Scripts
Page 2: The Make Art Button: Batches, Actions and Scripts

The Make Art Button:Batches, Actions and Scripts

Adrian WoodsTechnical Art LeadACES games group

Microsoft Game Studios

Page 3: The Make Art Button: Batches, Actions and Scripts

Who am I?

• Technical art lead for ACES games group at Microsoft (Flight Simulator, Train Simulator, Etc.)

• Managed assets for the entire world!• Thousands of models.• Thousands of textures.• Thousands of legacy files that need to be upgraded.• Thousands of lines of MaxScript.

Page 4: The Make Art Button: Batches, Actions and Scripts

“Established game studio seeks Technical Artist…”

• Admittedly not the most sexy topic at GDC. But it’s becoming more important daily.

• Content demands are increasing exponentially in both quality and quantity.

• Three years ago, technical artist wasn't really a position at any studio. Now there's one or two in every studio.

• How to keep up? Focusing your time on the creative content rather than the repetitive content.

Page 5: The Make Art Button: Batches, Actions and Scripts

Rule of three.

• Do something once, it's creative. Do something twice, it's annoying. Do something 3 times, it's manual labor.

• Can also be known as: If you do the same thing three times in a row, you're likely to do it again and again later on.

• Or… If you've done it three times manually, find a way to automate it.

Page 6: The Make Art Button: Batches, Actions and Scripts

Overview• The dreaded DOS prompt:

– A few tips and tricks to get the most from this ancient, but powerful operating system.

• Photoshop Actions and Droplets:– How to create them with examples.– Photoshop scripting?

• MaxScript– What you can do with it.– Sample tools.– The make art button in action.

• Questions?

Page 7: The Make Art Button: Batches, Actions and Scripts

The DOS prompt can be your friend

• When in doubt, get “help”– Gives you help for all known commands.– Shows you the switches and context for the

command.

Page 8: The Make Art Button: Batches, Actions and Scripts

No really, the DOS prompt likes you.

• Results in:

• “>” is a great tool.– Pipes output to a file.– File can then be manipulated with excel or

notepad.

Page 9: The Make Art Button: Batches, Actions and Scripts

Excel likes you as well.

• Which can quickly and easily be turned into this using find and replace commands:

• Which can be saved as a batch file that renames all of the “bump” files into “normal” files.

Page 10: The Make Art Button: Batches, Actions and Scripts

But the DOS prompt "likes you“ likes you.

• Extra Credit: The For loop– Intro to programming using DOS.– Very powerful, relatively easy to learn.– Easy to mess up as a novice. Always work with

backup files if you’re renaming or deleting.• For Example:

– C:>for /R %i in (*bump.psd) do copy %i C:\Xfer\GDC2006\RenameBumps\

– Is how I copied all the bump maps from our build into a single directory.

Page 11: The Make Art Button: Batches, Actions and Scripts

Using the FOR loop

• Simple FOR loop:– FOR %i in (*.psd) do echo %i– Will print out the name of each .psd file.

Similar to “dir *.psd”.– FOR %i in (*.psd) do mkdir %~ni&copy %i %~ni– Will make a directory for each .psd filename

and then copy the .psd into that directory.

Page 12: The Make Art Button: Batches, Actions and Scripts

Using the FOR loop

• Extra, Extra credit: More advanced FOR loops:– FOR /F "usebackq delims=bump" %i IN (`dir /b

*.psd`) DO copy %ibump.psd Result\%inormal.psd

• Using FOR loops with IF statements:– FOR /F "usebackq tokens=1,* delims=_;" %i IN

(`dir /b *.psd`) DO IF NOT EXIST %i (mkdir %i&copy %i_%j %i) ELSE copy %i_%j %i

Page 13: The Make Art Button: Batches, Actions and Scripts

Photoshop actions

• Actions are a simple scripting language in Photoshop.

• Record the set of steps in the actions window.

Pause Action

Stop recordingRecord Action

Play ActionNew Action SetNew ActionDelete Action

Each of the recorded steps withparameters

Page 14: The Make Art Button: Batches, Actions and Scripts

Photoshop actions

• Demo: Creating a simple normal map filter action.

• Actions can be called from within other actions (Meta and Uber actions)

• Demo: Creating an action that contains other actions within it.

Page 15: The Make Art Button: Batches, Actions and Scripts

Photoshop actions

• Photoshop has a powerful batch command that can perform an action on a whole set of images in a directory and / or its subdirectories.

Page 16: The Make Art Button: Batches, Actions and Scripts

Photoshop Droplets• Droplets are basically

actions that have been turned into an .exe and can be run from outside of Photoshop.

• Great for processing texture information from the command line (like in build scripts).

• As easy to create as batches.

Page 17: The Make Art Button: Batches, Actions and Scripts

Photoshop Droplets• You can drag and drop files onto the droplet

.exe and it will process them.• When running from command line, the full

image path name must be called.• Because you need the full path name, the

for loop works great for calling droplets on a bunch of files:– C:\>for %i in (*.psd) do FromGreyToBump.exe

%~fi

Page 18: The Make Art Button: Batches, Actions and Scripts

Photoshop Scripting?

• Actions are limited to “hard-coded” operations. This limits their ability to deal with variables.

• With CS, comes scripting for Photoshop.• Very powerful and can handle variables.• JavaScript language. If you’ve worked on it for the web, you can

probably pick it up quickly.

Notice hard-coded names

Page 19: The Make Art Button: Batches, Actions and Scripts

Photoshop Scripting!

• Photoshop has a whole reference library for the JavaScript commands that work in Photoshop. (Adobe Photoshop CS2\Scripting Guide\JavaScript Reference Guide.pdf)

• If you put scripts in Adobe Photoshop CS2\Presets\Scripts, they will show up in File>Scripts menu.

Page 20: The Make Art Button: Batches, Actions and Scripts

MaxScript

• If you can do it in Max, you can generally automate it in MaxScript. (There just may be a really convoluted way of getting there.)

• The listener is helpful, but most real commands don’t show up in the listener.

• Use other people’s scripts and the help reference as well. (3dsMax7\help\maxscript.chm)

• Don’t run the .chm from within Max, it will crash. (How nice.)

Page 21: The Make Art Button: Batches, Actions and Scripts

MaxScript

• Max 8 finally has a debugger! Yay!• We’re stuck on Max 7 until we ship. Nay!

(So I won’t be able to cover the debugger too much.)

• MaxScript can be used in a variety of different ways.

• “What ways?” you ask…

Page 22: The Make Art Button: Batches, Actions and Scripts

MaxScript

• MaxScript can be used to create simple tools from already existing Max tools.

• Demo of the Create Half-Pipe tool.• This toolset should be a part of the GDC

materials. So you can pull it apart and see how I wrote it (as well as make fun of my bad artist code.)

Page 23: The Make Art Button: Batches, Actions and Scripts

MaxScript

• MaxScript can be used to recreate original Max functionality that is poorly written or badly designed.

• Demo of FSX Shader tool.

Page 24: The Make Art Button: Batches, Actions and Scripts

MaxScript

• MaxScript can be used to manipulate UVs.

• Demo of UV tool suite.

Page 25: The Make Art Button: Batches, Actions and Scripts

MaxScript• MaxScript can be used

to create LOD viewers, verification tools, build interaction tools, and other powerful and time-saving tools.

• Demo of the Export and LOD tool.

Page 26: The Make Art Button: Batches, Actions and Scripts

MaxScript

• MaxScript can also be used to create methods of storing game information in your Max scene.

• Demo of the Attach Point Tool.

Page 27: The Make Art Button: Batches, Actions and Scripts

The Make Art Button...In action!

• Demo of an actual make art button:– From a single footprint, it is possible to

create a building in Max…– Pass the UV’d and rendered texture to

Photoshop…– Where a series of droplets create a

usable texture sheet…– Which is then passed back into Max as

the object texture sheet.– And a finished simple building is the

result.

Page 28: The Make Art Button: Batches, Actions and Scripts

The Make Art Button...In action!

• A similar (and much more elaborate) technique was used to create all of the background buildings in New York for King Kong.

• Perfect for those areas where you need to fill the skyline, but don’t have the manpower to hand-create every object needed.

• Similar techniques could be applied to foliage or the ubiquitous “crates”.

Page 29: The Make Art Button: Batches, Actions and Scripts

Maya?

• MEL is also a very powerful scripting language.

• Almost anything you can do in Maya, you can automate with MEL scripts.

• A little more like a programming language than MaxScript, but still relatively easy to learn (especially if you already know scripting basics).

Page 30: The Make Art Button: Batches, Actions and Scripts

Questions?

• Q & A.• Ask me anything.• If I don’t know the answer, I’ll make up

something that sounds convincing.• Thanks for sticking around this late on a

Friday.