Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

rs_ tag in render file names

12 REPLIES 12
Reply
Message 1 of 13
jamalade
1752 Views, 12 Replies

rs_ tag in render file names

Maya is automatically including "rs_" to my render file names..

I know that by not including something like <renderlayer> in the output name, maya will automatically incorporate render layer rinto the filename so I assume something similar is happening but I cant figure out how.

 

I guess rs_ means I'm using the new ext2 'render setup' but I dont really want this when I have long render sequences with multiple render layers... 

 

any help wouldbemuch appreciated.

 

Best

James

 

12 REPLIES 12
Message 2 of 13
jamalade
in reply to: jamalade

just an update, opening a 2016ext2 scene with an earlier version of maya, the render layer names do display "rs_ "in the render name. so this prefix is automatic and hidden for 2016ext2. still looking for a means to turn this off!? i'm sure there is a check box somewhere..

Message 3 of 13
pshwayka
in reply to: jamalade

In your Maya preferences under the rendering section, have you tried changing the Preferred Render Setup system option to "Legacy Render Layers?" (It defaults to "Render Setup.")

Message 4 of 13
jamalade
in reply to: pshwayka

I have, that just reverts maya back to the old render system.
Message 5 of 13
jamalade
in reply to: jamalade

sorry, just to clarify. I am using the new render system and happy to do so, I just need to find a way to remove the automatic prefix of "rs_" attached to all my outputted files.
Message 6 of 13
ddini
in reply to: jamalade

stumbled on the same problem on 2016 ext2. Need a solution too. tnx d.
Message 7 of 13
NandoStille
in reply to: ddini

Any update on this one?

 

The "rs_" prefix is even inserted when you set an absolute path without any tokens.

It's staggering how such a cumbersome naming "feature" could make it into 2017.

 

I must do something wrong. How to get rid of it?

Message 8 of 13
NandoStille
in reply to: NandoStille


@NandoStille wrote:

The "rs_" prefix is even inserted when you set an absolute path without any tokens.

 


Wait. Seems to be an update issue. After switching layers around the imageFilePrefix override finally worked. Well, I admit, otherwise it would have been a quite intelligent algorithm to find the part of my absolute path which specifies the renderLayer name. 😉

 

Anyway would be nice if one could work with the tokens without having "rs_" added to the renderLayer name.

Message 9 of 13
Anonymous
in reply to: jamalade

I've been having trouble with this too. There's a fair bit of information about it here:

 https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/Maya/fil...

 

But none of that seems to help me much...One thing I have noticed is that when you create a new layer in the render set-up window, a new dropdown appears right at the top of the render settings window with the name 'rs_[nameofyourlayer]'. Even though it doesn't show the rs_ in the render setup window.

Message 10 of 13
Anonymous
in reply to: jamalade

However, another thing I saw, is in the maya preferences, under rendering there is a render setup template that it loads from your c drive in C:/Users/username/Documents/maya\RSTemplates

As a default it is empty but perhaps that's where to add something.

Message 11 of 13
Anonymous
in reply to: jamalade

alright, I kinda found the solution.

 

if you go into C:\Program Files\Autodesk\Maya2017\Python\Lib\site-packages\maya\app\renderSetup\model

there is a file called legacyRenderLayer.py

If you open up that file you can see somewhere at the top the rs_ tags being generated:

 

def create(parentName):
with profiler.ProfilerMgr('create'):
newName = 'rs_%s' % parentName
return cmds.createRenderLayer(name=newName, empty=True)


def rename(oldLegacyRenderLayerName, newParentName):
with profiler.ProfilerMgr('rename'):
cmds.rename(oldLegacyRenderLayerName, 'rs_%s' % newParentName)

 

So, i tried remove specifically rs_ that you see twice. It worked great, the rs_ is now gone BUT now it automatically generates numbers after your render layer name. So if you call your render layer 'test', it will appear as 'test1' in your render settings. great..............

God knows how to solve this. All I would say is that EVERYONE using the maya render setup is having this issue because it's coded into the program. And for this to be fixed properly, autodesk has to change it and create a tick-box or something.

 

Sweeet, you welcome.

 

 

 

Message 12 of 13
MRAnim8or
in reply to: Anonymous

We ran into this problem here today and I figured out why its happening and a solution. The problem has nothing to do with what renderer you are using, and is still a problem in the most current version of Maya, as of this writing: Maya 2018 update 2.

 

Maya obviously has two render layer systems, the old (legacy) system, and the newer renderSetup layers. If you are using the renderSetup layer system (which I believe Maya defaults to nowadays) when you create a renderSetup layer, it also creates a corresponding legacy layer. Since two objects cannot have the same name in Maya (unless they are parented to different things) the legacy layer is named with rs_ at the start of the name.

 

UNFORTUNATELY, when you use the <RenderLayer> preset in the Common tab of Render Settings, it grabs the name of the LEGACY layer (with the rs_ at the start),not the renderSetup layer, even if you are using renderSetup layers. I have no clue what 'genius' at Autodesk implemented the renderSetup system and then forgot to support it in Render Settings, but I digress....

 

Ok, so whats the solution?  I am using Maya's PreRender and PostRender mel scripts to get around the problem. When you render, a PreRender script switches around the names of both the legacy and renderSetup layers.   After the render is kicked off, a PostRender script renames everything back to how it used to be. Your renders will come out fine and not have the annoying rs_ in the file or folder names.  This solution will work on any version of Maya, and for any renderer. It is harmless to use even if somebody at Autodesk bothers to fix the bug properly (gasp).

 

1) Save this code as PreRender.py in your Maya prefs scripts directory

  in linux its /home/ (USER NAME)/maya/ (VERSION NUMBER)/prefs/scripts.

   In Windows its C:\Users\ (USER NAME) \ My Documents\maya\prefs\scripts

 

 


def PreRender():
    import maya.cmds as mc

    ### To not conflict with the renderSetup layers, the auto-generated old layers start with rs_
    ### Unfortuantely the Maya Common 'File name prefix' <RenderLayer> setting uses the OLD layer system names,
    ### despite rendering from the new layer system. So the layers are all named rs_.  This snippet renames
    ### the renderSetup layers to rl_(layer name) and renames the rs_(layer name) layers to just (layer name).
    ### a corresponding postrender script names them back.
    for Layer in mc.ls(typ="renderSetupLayer"):
        if not Layer.startswith("rl_"):
            try:
                mc.rename(Layer,"rl_"+Layer)
            except:
                pass
    for Layer in mc.ls(typ="renderLayer"):
        if Layer.startswith("rs_"):
            try:
                mc.rename(Layer,Layer[3:])
            except:
                pass

 

2) Save this code to the same directory, using the name PostRender.py

 

 

def PostRender():
    #### renames the layers back to what they were before rendering, restoring the original renderSetup name and adding rs_ back to the old system render layer names

    import maya.cmds as mc

    for Layer in mc.ls(typ="renderLayer"):
        if not Layer.startswith("rs_"):
            try:
                mc.rename(Layer, "rs_" + Layer)
            except:
                pass
    for Layer in mc.ls(typ="renderSetupLayer"):
        if Layer.startswith("rl_"):
            try:
                mc.rename(Layer,Layer[3:])
            except:
                pass

 

3) Every time you make a new scene you want to render, go to the Common tab of Render Settings,  and add this to pre Render Mel under the Render Options rollout.

 

python("from PreRender import *;import PreRender;PreRender.PreRender()");

4) Add this to the post Render Mel under the same rollout.

 

 

python("from PostRender import *;import PostRender;PostRender.PostRender()");

 

 

 

 

 

 

Message 13 of 13
jamalade
in reply to: MRAnim8or

Thanks for the response and sharing your scripts, I've not used 2017 but jumped straight to 2018.1 and I don't appear to have this problem anymore. I've tested importing 2016.5 scenes with render layers and apart from a popup about improved collection handling the renderlayers now seem to render without prepending "rs_". Are you working with scenes that originated from the 2016 version of maya? i wonder if some legacy stuff has carried over.

 

Looking through the release notes there is a fix in 2017.4 that fixed a bug introduced in 2017.3 after some improvements were made to rendersetup including "MAYA-78844 Render Setup improved for working in a render farm environment" I don't have time to install this specific version of Maya  and test this but I assume this was the necessary fix. I can still see the render nodes named as rs_#### in the hypershade but this is ignored at rendertime.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report