Complex UV Layout in Maya
Over the last couple of years UV layout in Maya has changed for the better. In this course we're going to be taking a look at some of those changes as we UV map an entire character
# 1 08-11-2008 , 01:55 PM
Registered User
Join Date: Oct 2008
Location: Sheffield, England
Posts: 6

Script Editor (Image name for each Image)

Hi i'm trying to make a script that renames each image while rendering, im still nooby at this so hoping sombody else knows the answer >.<

neway heres my problem.

the first image should be called 000000
2nd000001
3rd 000002
4th 0000003

however everytime i do it, there all called 000003,

really need this script, when u have to do 50 of these, 600 and odd images each it really becomes a strugle >.<
here is the script:

setAttr -type "string" defaultRenderGlobals.imageFilePrefix "000000";
changeMayaSoftwareFileNamePrefix;
updateMayaSoftwareFileNamePrefixControl;
updateMayaSoftwareTargetFilePreview;
timeControl -e -beginScrub $gPlayBackSlider;
// Result: MayaWindow|mayaMainWindowForm|TimeSliderForm|formL ayout16|formLayout17|formLayout45|frameLayout2|tim eControl1 //
currentTime 10 ;
timeControl -e -endScrub $gPlayBackSlider;
// Result: MayaWindow|mayaMainWindowForm|TimeSliderForm|formL ayout16|formLayout17|formLayout45|frameLayout2|tim eControl1 //
floatField -edit -value `currentTime -query` MayaWindow|mayaMainWindowForm|TimeSliderForm|formL ayout16|formLayout17|formLayout45|floatField1;
// Result: MayaWindow|mayaMainWindowForm|TimeSliderForm|formL ayout16|formLayout17|formLayout45|floatField1 //
ikSelectionChanged("MayaWindow|mainKeysMenu|menuIt em729|ikFKStateItem");
renderWindowRender redoPreviousRender renderView;
playButtonStepForward;
floatField -edit -value `currentTime -query` MayaWindow|mayaMainWindowForm|TimeSliderForm|formL ayout16|formLayout17|formLayout45|floatField1;
// Result: MayaWindow|mayaMainWindowForm|TimeSliderForm|formL ayout16|formLayout17|formLayout45|floatField1 //
ikSelectionChanged("MayaWindow|mainKeysMenu|menuIt em729|ikFKStateItem");
setAttr -type "string" defaultRenderGlobals.imageFilePrefix "000001";
changeMayaSoftwareFileNamePrefix;
updateMayaSoftwareFileNamePrefixControl;
updateMayaSoftwareTargetFilePreview;
renderWindowRender redoPreviousRender renderView;
playButtonStepForward;
floatField -edit -value `currentTime -query` MayaWindow|mayaMainWindowForm|TimeSliderForm|formL ayout16|formLayout17|formLayout45|floatField1;
// Result: MayaWindow|mayaMainWindowForm|TimeSliderForm|formL ayout16|formLayout17|formLayout45|floatField1 //
ikSelectionChanged("MayaWindow|mainKeysMenu|menuIt em729|ikFKStateItem");
setAttr -type "string" defaultRenderGlobals.imageFilePrefix "000002";
changeMayaSoftwareFileNamePrefix;
updateMayaSoftwareFileNamePrefixControl;
updateMayaSoftwareTargetFilePreview;
renderWindowRender redoPreviousRender renderView;
playButtonStepForward;
floatField -edit -value `currentTime -query` MayaWindow|mayaMainWindowForm|TimeSliderForm|formL ayout16|formLayout17|formLayout45|floatField1;
// Result: MayaWindow|mayaMainWindowForm|TimeSliderForm|formL ayout16|formLayout17|formLayout45|floatField1 //
ikSelectionChanged("MayaWindow|mainKeysMenu|menuIt em729|ikFKStateItem");
setAttr -type "string" defaultRenderGlobals.imageFilePrefix "000003";
changeMayaSoftwareFileNamePrefix;
updateMayaSoftwareFileNamePrefixControl;
updateMayaSoftwareTargetFilePreview;
renderWindowRender redoPreviousRender renderView;

# 2 08-11-2008 , 02:08 PM
Chirone's Avatar
Subscriber
Join Date: Dec 2007
Location: NZ
Posts: 3,125
does it have to start at 00000?
why not batch render from 00001 to 99999

you can change the output file names in the render settings




that's a "Ch" pronounced as a "K"

Computer skills I should have:
Objective C, C#, Java, MEL. Python, C++, XML, JavaScript, XSLT, HTML, SQL, CSS, FXScript, Clips, SOAR, ActionScript, OpenGL, DirectX
Maya, XSI, Photoshop, AfterEffects, Motion, Illustrator, Flash, Swift3D
# 3 08-11-2008 , 02:16 PM
Registered User
Join Date: Oct 2008
Location: Sheffield, England
Posts: 6
unfortunatly it has to start from 00000 and go up too 000600 :s

# 4 08-11-2008 , 02:22 PM
Registered User
Join Date: Oct 2008
Location: Sheffield, England
Posts: 6
sorry forgot to mention

setAttr -type "string" defaultRenderGlobals.imageFilePrefix "000003"; parts are the changeing the name in rendering settings, but for some reason, all the images come out as 000003

# 5 08-11-2008 , 02:28 PM
Chirone's Avatar
Subscriber
Join Date: Dec 2007
Location: NZ
Posts: 3,125
wait, so you're hard-coding it all in?
dude... that's gonna be a bitch.....
I'm not too too confident in MEL scripting but my solution to this problem is to write a program to renamed them all afterwards

or write a batch file to loop through them all.

can i ask why it has to start from 00000?




that's a "Ch" pronounced as a "K"

Computer skills I should have:
Objective C, C#, Java, MEL. Python, C++, XML, JavaScript, XSLT, HTML, SQL, CSS, FXScript, Clips, SOAR, ActionScript, OpenGL, DirectX
Maya, XSI, Photoshop, AfterEffects, Motion, Illustrator, Flash, Swift3D
# 6 08-11-2008 , 02:34 PM
Registered User
Join Date: Oct 2008
Location: Sheffield, England
Posts: 6
its for a game, the images start from 00000 and go to up 000003, then it changes direction and misses 4 images and starts again at 000007 and keeps going in different numbers each different animation 'bunch' this part ill have to do on a lot of different images. so it may be better to get it all in a script befor i bothere doing the other 40 of them >.<.

when i did it image by image befor, it took a day, i would prefer to do all 40 in 1 day :p

# 7 08-11-2008 , 02:40 PM
Chirone's Avatar
Subscriber
Join Date: Dec 2007
Location: NZ
Posts: 3,125
if it's just renaming you're after then you can just rename it after its all been rendered

i found a few links to programs that can mass rename stuff (googled "batch file rename", i was actually looking for how to write a batch file to rename stuff but i got these instead)

https://www.freedownloadscenter.com/U...e_Renamer.html

https://www.publicspace.net/windows/B...ame/index.html

i know it's probably a pain having to rename things AFTER the rendering, we're using computers, and this is something computers are for, so you can just automate the task




that's a "Ch" pronounced as a "K"

Computer skills I should have:
Objective C, C#, Java, MEL. Python, C++, XML, JavaScript, XSLT, HTML, SQL, CSS, FXScript, Clips, SOAR, ActionScript, OpenGL, DirectX
Maya, XSI, Photoshop, AfterEffects, Motion, Illustrator, Flash, Swift3D
# 8 08-11-2008 , 02:52 PM
Registered User
Join Date: Oct 2008
Location: Sheffield, England
Posts: 6
unfortunatly it wouldnt work with a batch editor.

the animation button for the 4 images in direction 1 would be 000000-3
then with the same animations the but with the direction aim at 25 degree rotation would also be 000000-3

so cant mass render and rename them after :/. is there any other way to rename the images outside of render setting? maybe the code can lead me elsewhere for it to work.

thanx in advance and for the replys allready.

my fault for not explaining my situation well enough.

# 9 08-11-2008 , 03:10 PM
Registered User
Join Date: Oct 2008
Location: Sheffield, England
Posts: 6
probably easier to redo the timeslide, so im gonna do that rather than strugle with the image names, ty for the replys though, much appreciated.

# 10 09-11-2008 , 12:13 AM
gster123's Avatar
Moderator
Join Date: May 2005
Location: Manchester Uk
Posts: 6,300
Bit confused with this one, so you want to have say 00000 anmd then render to say 00060 in the order of 00001, 00002, 00003 etc?

Or do you want them to jump about?

if its just liniar coulednt you use frame padding in the render globals to get what you need?


"No pressure, no diamonds" Thomas Carlyle
# 11 09-11-2008 , 01:21 AM
AikoWorld's Avatar
Subscriber
Join Date: Dec 2005
Location: London
Posts: 429
yes, the framepadding dose what you are looking for
jus set it to 5

and it will render out 00001 00002 etc...

What your doing by copying the current output of the editor then changing the number is just triple work.

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads