Jump to content

How to copy FBX generated runtimes


photo

Recommended Posts

Hello I am trying to create a complete copy of the runtime assets generated during an FBX import to a custom folder.

So basically what I would like to end up with is a folder structure just made of a main node and all native assets like this:

myasset.node

Textures/ ... all dds textures

Meshes/ ... all mesh files

Animations/.. all animation files

Materials / ... all materials pointing to the proper dds textures

 

 

So created an AssetImporter.cs component with a public parameter

    [ParameterFile]
    public string AssetPath;

then on a keydown event I do

            

var guid = FileSystem.GetGUID(AssetPath);
            string target = "test";
            var newguid = FileSystemAssets.CopyRuntime(guid, target);

but this does not work,as the refered guid is not the fbx file itself but the node within the fbx...

I also tried to iterate through the runtimes like this but num runtimes ==0...

            int numruntimes = FileSystemAssets.GetNumRuntimes(guid);
            for (int j = 0; j < numruntimes; j++)
            {
                var runtimeguid = FileSystemAssets.GetRuntimeGUID(guid, j);
                 Log.Message("\nguid " + guid.ToString() + " runtime " + runtimeguid.ToString() + " - Copied at " + target);
            }

 

I also tried to use the new AssetLinkNode C# functionality in order to load the node and have the node hyerarchy there but could not make it work either...

what would be the best way to do this ?

 

thanks

Fred

 

 

 

 

 

 

 

Link to comment

Hello,

Try to use FileSystemAssets.GetAssetGUID(path) instead of FileSystem.GetGUID(path). In this case, you will get correct number of runtimes. In attached sample, I am trying to copy runtimes to custom folder.CopyAsset.cs

  • Thanks 1
Link to comment
×
×
  • Create New...