[Solved] Add scene or assets in "Smart Content/Saved Files/Local User"?

V3DigitimesV3Digitimes Posts: 3,150

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.

 

 

Post edited by V3Digitimes on

Comments

  • rbtwhizrbtwhiz Posts: 2,250
    edited March 2016

    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 is setFileMetadata(). 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 and insertAsset(), but that will take more time/code and you end up using DzAsset in the end anyway.

    -Rob

     

    Post edited by rbtwhiz on
  • V3DigitimesV3Digitimes Posts: 3,150

    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!

     

     

  • V3DigitimesV3Digitimes Posts: 3,150

    Solved, you were right, it was 2 lines only ! If everything could be that easy xD!

Sign In or Register to comment.