Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Maya Basics & Newbie Lounge (https://simplymaya.com/forum/forumdisplay.php?f=31)
-   -   Script Editor (Image name for each Image) (https://simplymaya.com/forum/showthread.php?t=31309)

Buggy 08-11-2008 01:55 PM

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;

Chirone 08-11-2008 02:08 PM

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

Buggy 08-11-2008 02:16 PM

unfortunatly it has to start from 00000 and go up too 000600 :s

Buggy 08-11-2008 02:22 PM

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

Chirone 08-11-2008 02:28 PM

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?

Buggy 08-11-2008 02:34 PM

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

Chirone 08-11-2008 02:40 PM

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)

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

http://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

Buggy 08-11-2008 02:52 PM

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.

Buggy 08-11-2008 03:10 PM

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.

gster123 09-11-2008 12:13 AM

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?

AikoWorld 09-11-2008 01:21 AM

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.


All times are GMT. The time now is 01:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018