Closed orofri closed 9 months ago
Hi ! Unfortunately this feature is not really possible. The picker content is imported in the maya file and drop the references to the original file. So no possibility to be relative to unkown information.
Of course the paths can be variable from an user to another, the solution we suggest in that case is to use environment variables in the images path. For example, you save all the project picker in a single folder. A user copy this folder at this localtion: c:/my_picker_collection
If you setup this path for an image in the folder $PICKER_FOLDER/images/bear.png
You have to setup the variable environment PICKER_FOLDER = c:/my_picker_collection and the picker will automatically resolve the path to c:/my_picker_collection/images/bear.png
With that trick, everyone can setup the folder he needs to.
More infos about setuping environment variables under windows here: https://docs.oracle.com/cd/E83411_01/OREAD/creating-and-modifying-environment-variables-on-windows.htm#OREAD158
but I think you can also just type this command in the terminal to setup that:
setx PICKER_FOLDER
Have a nice week
Lio
Hey Lio,
Thanks for your comment!
I think it can be much simpler... Can't we set a temp variable in python with the path to the folder of the pickerName.json file the user is opening before it actually opens/loads the picker? If we will set/change this path every time we're opening a picker we can get this "relative" path easily.
Let me try to simplify my idea. On the pickerName.json file we will store a relative path of the images: "image.path": "MyPicker_BG.jpg",
Then before we open/load the .json file, the python script will store in a temporary variable the location of the .json file and add that to the path of the image when it loads the picker. So it will basically resolve it automatically. The temporary variable will change every time we open a new picker, so the images will stay relative to every picker .json file.
I hope it make sense... Thank you! Or :)
Hi Thanks again for sharing your reflexion. Unfortunately, I see a big issue in your proposal. Just a bit of history about the "why" we do store the picker in the scene
It's a request from animators that they want to be able to pimp their picker by shot. Get free without beeing afraid or erasing the production file. They want to keep the modifications if the shot is reassigned to another person. This mainly used when shot contains props or specific constaint. At first release, I asked my team if that feature was really necessary. The possibility to remove this system to implement a system of relative image path instead, was a no go zone.
So If we follow your idea, here's an example of a bad situation:
Right now, I don't see better solution that using variables in the paths.
By the way, I'm not totally unsensitive to the facts you it is too technical for common animators. I took a bit of time to define how I can improve this (thats why my reply came late, sorry). So Here is my proposale to avoid that painfull os configuration: For animator side, I will add a field in the picker preferences (that animator can easily setup) to erase the $PICKERS_FOLDER variable. For the picker maker side, When he add an image, if the image root correspond to the PICKERS_FOLDER he setup on his side, the path will be automatically replaced by the variable one
How do you feel that ? I will keep this ticket closed, but I created this one #78 instead. If you are good with that, I will add this system soon !
Cheers
done You can setup you own picker folder directory by an environment variable or directly in the picker preferences. If the variable is set, the image path will be automatically changed at import time. Everyone can setup the path he desire for his machine in the preferences ! cheers
It would be helpful to have relative path for images so it the user won't need to re-link the path on every computer. The relative path should be determined by the path of the picker file(.json file)