0

I have a JSON file that has parity with a maya scene. The maya scene file name usually goes through several increment or naming changes, but the JSON file would not .

My current script was trying to find the JSON file from the maya file name ( for example there’s a value in the JSON file with what scene it came from - but that’s ugly )

Eg

fencingLayout.json fencing1.mb fencing2.mb ... renamed4.mb

So what I’m looking for is a way to associate a JSON file with a maya scene , irrespective of the maya scene location or name . Is there a reference node or some scene variable that could be used to store that string path, and easily queried ?

Thanks

blam
  • 87
  • 1
  • 8
  • Can you give us context on what you're storing in your json file? It might make more sense to store it directly in the scene depending on what it is. – Green Cell Jul 04 '19 at 09:48
  • you could create an attribute on a node and put the json path, so yeah it could be a referenced node. It is difficult to advice because you should precise, what it does, how it is related to the scene file incrementation...etc – DrWeeny Jul 04 '19 at 16:57
  • @GreenCell thanks , it’s storing an array of dicts . The dicts hold values such as string names of objects in that maya scene , some position data ( as dicts) , and some floats . Maya would be loading, querying , and possibly adding more data in to the json file from users inputs . – blam Jul 04 '19 at 20:28
  • @DrWeeny it’s a basic setup whereby artists associate an object in the maya scene with some positions , and some float values . They would query and append more data into the json file as they model or make data inside maya via a UI. The scene file incrementing or renaming would have no relationship to the json file , it’s all about the objects in the scene . Artists should be able to name and increment the maya file as they see fit . The reason for a JSON file is a manner to store the results of a UI I’ve written, eg a bit like action history that I can recall – blam Jul 04 '19 at 20:31
  • Hmm well is the user working on an asset? Maybe you can let the user name the asset he's working on, then store that name somewhere in the scene. Could just be a simple string attribute on a node. Then name your json file to match that asset name, so no matter what the scene is renamed to, it knows what json to collect from. Is something like that feasible? – Green Cell Jul 05 '19 at 02:44
  • The first your ui is opened, you can create an attribute on a node (or even a node that you create) with a path to your json. So each time your ui is opened it checks that this attribute exists. Does your project structure contains : user,shot/asset var, scene dir var, department var, because you could create otherwise a name based on the task – DrWeeny Jul 05 '19 at 03:43

0 Answers0