SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.


SM Forums / Lounges / Maya Basics & Newbie Lounge / Script Editor (Image name for each Image)

Maya Basics & Newbie Lounge Please post in this section ONLY if your question doesn't fit in anywhere else on the forum, or if you're not sure which section it's relevant to. We also have Free streaming trial available.

Join the conversation. Reply to post
 
Thread Tools
08-11-2008, 01:55 PM   #1
Buggy
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;
  Reply with quote
08-11-2008, 02:08 PM   #2
Chirone
Subscriber
 
Chirone's Avatar
 
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
  Reply with quote
08-11-2008, 02:16 PM   #3
Buggy
Registered User
 
Join Date: Oct 2008
Location: Sheffield, England
Posts: 6
unfortunatly it has to start from 00000 and go up too 000600 :s
  Reply with quote
08-11-2008, 02:22 PM   #4
Buggy
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
  Reply with quote
08-11-2008, 02:28 PM   #5
Chirone
Subscriber
 
Chirone's Avatar
 
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
  Reply with quote
08-11-2008, 02:34 PM   #6
Buggy
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
  Reply with quote
08-11-2008, 02:40 PM   #7
Chirone
Subscriber
 
Chirone's Avatar
 
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)

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
__________________


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
  Reply with quote
08-11-2008, 02:52 PM   #8
Buggy
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.
  Reply with quote
08-11-2008, 03:10 PM   #9
Buggy
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.
  Reply with quote
09-11-2008, 12:13 AM   #10
gster123
Moderator
 
gster123's Avatar
 
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
  Reply with quote
09-11-2008, 01:21 AM   #11
AikoWorld
Subscriber
 
AikoWorld's Avatar
 
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.
  Reply with quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Image Plane In Viewport 2.0? & TazzyUK Maya Basics & Newbie Lounge 0 25-03-2016 06:48 PM
Create Reference Image Planes - Mel Script kbrown Programming 29 30-03-2014 08:04 PM
changing the "Quick help" window size in the maya 2012 script editor. Jouri Programming 3 27-11-2011 06:15 AM
Need image of a city building rooftop. Darkware Maya Basics & Newbie Lounge 0 07-10-2003 02:16 PM
Positioning reference images in viewports (Image Planes) megaton Maya Basics & Newbie Lounge 3 27-05-2003 11:42 AM