CODE Import mesh code for DankFF (1 Viewer)

FusionFall.org

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

new_mesh = tabledata.add_object(43)
import_mesh(new_mesh.contents, 'path_to_mesh')
tabledata.add2ab('some_new_path_in_tabledata.obj', new_mesh.path_id)

oops it has to be 43 not 45


it works, but I have a problem

yeah?

this line --- > import_mesh(new_mesh.contents, 'example')
when I try it, I get an error
Error Type: FileNotFoundError
[Errno 2] No such file or directory: 'example'
I changed the line to ---> import_mesh(new_mesh.contents, 'example.obj')
and then it worked
but it's not right inside the bundle
i'll show you
Image

it's just called .obj
I assume I wasn't supposed to add .obj there but it's the only thing that fixed it

that's ok, but which name you entered for tabledata.add2ab ?

tabledata.add2ab('example.obj', new_mesh.path_id)

maybe give it a name
new_mesh.contents.name = 'some_name'
and then save

that worked
😄
 

Attachments

  • meshcode.txt
    1.2 KB · Views: 29
Top