[Solved] Add scene or assets in "Smart Content/Saved Files/Local User"?
Hello,
I am trying to see if there is a way to add a scene (I guess it would be similar for assets) in the "Saved Files/Local User" category of the Smart Content in DS 4.9? The scene is saved by script using App.getAssetIOMgr().doSaveWithOptions
I was trying to find a command in App.getContentMgr() but without success.
Then I told to myself it may not be in the Content Manager since these files may not be in any content library. So I looked at the "App" level to see what I could find, but I don't manage to see anything inspiring me the right way. I was looking for something like "App.getSmartContentMgr" but there is no such element. Maybe the App.getAssetIOMgr?
Anyone having an idea on the subject?
This should be possible because if you save a new scene "the classical way" this is automatically done, so this should also be possible to do it when a scene is saved by script with doSaveWithOptions() too.
Comments
I'm not in a position to respond with a specific example at the moment (though I did just post several metadata related samples), but the object you want is DzAssetMgr; get it using DzApp
::getAssetMgr()
.DzAssetMgr
is one of the main objects that deal with metadata. The (static) method you want to use issetFileMetadata()
. You can get the current categories that an asset is in from DzAsset::categories
(see the Asset Categories sample), but you cannot set them from there. You could also walk the DzCategoryAssetContainer hierarchy andinsertAsset()
, but that will take more time/code and you end up usingDzAsset
in the end anyway.-Rob
Thank you Rob,
I'm gonna have a look at the DzAsset Manager. I already had a look the metadata related samples but I have probably not spent enough time on them to clearly understand each step, and I had finally decided it was not related to what I wanted to do (obviously I was wrong!).
I'm gonna try with this, at least now I know that I have to work in the asset manager and the key command will be "setFileMetadata".
Thanks a lot!
Solved, you were right, it was 2 lines only ! If everything could be that easy xD!