Home Website Youtube GitHub

Animpicker relative path?

Hi everybody!

I have some people asking me why the animpicker is not showing any background images.
I checked the file and It seems like animpicker images are set to absolute path:

can it be set to relative to the project set, so it will load for everyone using it?


1 Like

Hey @Milio

Is the path shown not one accessible to everyone on the network?

Further to your point tho, we only have a basic implementation of images and pathing thus far. So everything does get baked down to an absolute path. We haven’t really discussed any options for handling that differently.

If you, or anyone, have any suggestions on how we could go about this lets talk!

1 Like

There is an environment variable for anim_picker to set relative paths: ANIM_PICKER_PATH

should be used as a token in the path: [ANIM_PICKER_PATH]/your_picker_folder/your_picker.pkr


But you need to set it manually in de node :stuck_out_tongue:


Thank you Rafael!

It is mostly for people who downloaded the rig place it locally and therefore having a different path.
I guess, for this sort of rig distribution, where every single user can potentially have a different location, a setup like source images will be ideal: just relative to the project set. People can edit the animpicker file in Maya and save it, or also use notepad++ for setting the correct path for the backgrounds, but I think pretty much nobody will ever do that.


1 Like

ohhhh! That will do! I’ll give it a go after work.
thank you @Miquel!!!

Even in my current productions, we’re cross-platform. I’m on Mac, and most of my animators are on Windows.

What could be interesting is if we could embed the image pixel information directly in the picker node in the scene. (As an option.) Not sure if that is feasible or desirable.


haha! I didnt manage to understand where to set that “token”! I’m quite limited! 8-o

1 Like

Hi All,
Sorry this is a very old thread I’m replying to… I to am having a headache dealing with the file pathing specifically for the background image of the picker since we have artists using different drives on the network.

The environment variable [ANIM_PICKER_PATH] you mentioned previously works great only for the pkr file itself:

But the file path for the background image in the data attr on the picker node (DATAS_ATTR ) is different?

Example: ‘background’ : E:\\\\Main\\\\ContentSource\\\\Animation\\\\Pickers\\\\MyPickerFolder\\\\MyPickerBackround.png

So this won’t work:

How do you guys get around this?

:thinking:Modify the MainDockWindow class to point directly to the file path? Forgoing the picker node?

:thinking:Have a special pkr button that kills all picker nodes in a preexisting scene and creates new ones with proper pathing?

:unamused:Got my 23andme back an found out I’m more neanderthal than anything else, so maybe that’s the issue to: )

I’m assuming you have to add to your Maya.env file, to define what the path is. The “ANIM_PICKER_VAR” isn’t magic. It’s just a keyword you can use to store a path. (If it is magic, please correct me, Miquel. :wink: )

Close Maya first. Then in Maya.env in your Maya preferences, add:

(And make sure you replace /YOUR/PATH/HERE with your actual path to where you’ll store the images.)

(Or else, you could probably add it to your environment variables in your operating system. But I think it would make more sense to store it in your Maya.env)

(Also, maybe I’m wrong since you said the token already worked for you for the Picker itself.)

Thanks @chrislesage!
Ah, I should have mentioned I was setting that Var on my instance of maya manually before testing.
os.environ[‘ANIM_PICKER_VAR’] = os.getenv(“MAYA_PROJECT”).replace("\", “/”) + ‘/ContentSource/Animation/Pickers’
So [‘ANIM_PICKER_VAR’] = 'E:/Main/ContentSource/Animation/Pickers’

But yea, I think the maya.env would be a lovely place to set that.

At least “I think” the .pkr file is being loaded in correctly? I’m writing it manually like so in thePickerDatasFile Attr on the picker node :

But, it could be just looking at the PickerDatas Attr and building the picker from it, instead of the actual file? Either way I get a functioning picker with no background and the following error. :thinking:

**# background image not found: ‘C:\Users\Me\AppData\Local\UnrealGameSync\Tools\Maya2022\Current[ANIM_PICKER_VAR]\MyPickerFolder\MyPickerBackround.png’ (very confused why i get this but am looking into it now)

1 Like

On a side note, and just my opinion:
I love the Picker and where its going! But I’m not a fan of extra import/export nodes cluttering up the scene, I’m wondering if it would possible at some point in time to just add the picker path an info on the rig’s assemble node or somewhere else on the Rig instead?

Can you elaborate on how they are cluttering your scene? You can parent them under another transform to tuck them away.

Also I hide the transform of my Picker nodes, because technically they are selectable in the viewport, which affects viewport-framing too.

But there are commands to load a picker via Python. So you could likely store that info somehow and call it with a Callback or a shelf or menu tool. Or during the Shifter build if that’s what you meant. If I’m not misunderstanding what you’re talking about, maybe this is relevant: Load .pkr File Using Python - #2 by chrislesage and Load .pkr File Using Python - #5 by RagnarB

Thanks Chrislesage,

All great points… An yea, I can hide them, tuck them away, but there still there, it’s still an extra node that needs maintaining? I know there’s lots of reasons it’s a good idea to have a picker node (moving files around, dealing with outsourcers ect.) So this is all purely a suggestion and maybe not a good one…

My initial thought was to those Attrs on a specific location on the rig itself (maybe the rigs top assemble node?). That way it always goes along for the ride with the rig. You could maybe use the namespace when the rig is referenced as default naming or something for the animpicker. We would always know where those attrs are as well. Anyways, I’m sure there’s very good reasons against this…

Thanks for the links to the conversations about updating and creating Picker nodes. Sorry if I’m overlooking something here. The issue is if I make a new node in my animation source file and save my scene then someone else opens up my scene but is mapped to a different drive they will have to create another node?

Your script that updates the picker node based off of the file is close to what i need and i can probably get something working off of that. But It would be super nice to get that [ANIM_PICKER_VAR] token to work?

I’m trying the following:

First I’m manually creating a Environment variable called ANIM_PICKER_VAR with the first half of my path.

import pymel.core as pm
from mgear import anim_picker

# If you already have picker nodes in the scene, you can find them this way.
pickerNodes = anim_picker.picker_node.get_nodes()

# Set the file path on the node
yourDataPath = ‘[ANIM_PICKER_VAR]/Drone/Drone_Picker.pkr’
pickerNodes[0]._set_str_attr(newPicker.FILE_ATTR, value=yourDataPath)
# This writes ‘[ANIM_PICKER_VAR]/MyPickerDir/My_Picker.pkr’ string in the FILE_ATTR

# Reads the data from the file attribute on the picker node
pickerDataFromFile = pickerNodes[0].read_data_from_file()
# pickerDataFromFile is None after running this.

Also I noticed a little thing here… On this function the env is called two different things (ANIM_PICKER_PATH, and ANIM_PICKER_VAR?). I went with ANIM_PICKER_VAR as that is what seems to be what the function is looking for but no dice…

At the end of the day i just need a relative path for the file FILE_ATTR but can’t seem to get it working.