CODE Import texture code for DankFF (1 Viewer)

FusionFall.org

Website Owner
Staff member
Website Owner
Member
from unitypack.modding import import_texture

new_texture = tabledata.add_object(28)
import_texture(new_texture._contents, 'path_to_your_image.png', 'some_name', 'dxt5')
tabledata.add2ab('some_new_path_in_tabledata.png', new_texture.path_id)


"does the 28 ever need to be changed? or do I always use that number?"

Nope it shouldn't be changed. It's the type id for a texture2d

and I don't change this --> new_texture.path_id ?

just change the things in quotes where i wrote
path_to_your_image some_name some_new_path...
 

Attachments

  • code.txt
    245 bytes · Views: 32

FusionFall.org

Website Owner
Staff member
Website Owner
Member
Update :
it wasn't asset it was tabledata
just execute the last line again
with tabledata instead of asset

from unitypack.modding import import_texture

new_texture = tabledata.add_object(28)
import_texture(new_texture._contents, 'path_to_your_image.png', 'some_name', 'dxt5')
asset.add2ab('some_new_path_in_tabledata.png', new_texture.path_id)


new_texture.path_id should be your index then
print(new_texture.path_id)

keep in mind some_name and some_new_path... have to be unique for the assetbundle
 

Attachments

  • code2.txt
    241 bytes · Views: 29
Top