I’m using the Python API to bulk import thousands of assets for an enterprise/industrial use case. This is working great, but along the way some of these assets should also have a sprite created.
I have looked through all the PaperSprite Python API docs and it’s still unclear to me how to trigger a sprite to be created from specific imported textures/images. Currently I’m batching imports via AssetImportTask in a list along with AssetTools.import_asset_tasks.
Any suggestions on starting points or something I missed in the docs? My goal is to discover all assets in a specific folder and if ‘XYZ_texture.uasset’ doesn’t have a corresponding sprite to create one.
Part of my pipeline involves periodically importing new and updating some existing assets and getting this scripted is pretty much essential.
Thanks in advance for any pointers in the right direction!
This may point you in the right direction. With Paper2D, when you right-click a texture asset in the Content Browser and go to “Sprite Actions” > “Create Sprite”, this C++ code gets run. You may be able to use this as a starting point by essentialy remaking the function in Python.
You can see that the actual creation of the sprite from a texture looks like this (really simple):