Loading texture using setEffect

37 views
Skip to first unread message

James Hwang

unread,
Jun 24, 2016, 5:00:27 PM6/24/16
to omegalib
def loadModel(name, path):
    model = ModelInfo()
    model.name = name
    model.path = path
    model.optimize = False
    model.usePowerOfTwoTextures = False
    scene.loadModel(model)
    model = StaticObject.create(name)
    model.setEffect("textured -d /home/evl/jhwang47/SENSEI-Panama/v1/")

loadModel("Terrain", modelPath+"/stripPathTerrain.fbx")

I have created an fbx file that is texture mapped using Blender. I exported the fbx in several ways. 1 with relative paths. 2 with stripped paths. I keep running into the same error that it cannot find the texture file. 

Loading model....../home/evl/jhwang47/SENSEI-Panama/v1/stripPathTerrain.fbx
!!! ImageUtils::loadImage: could not load /home/evl/jhwang47/SENSEI-Panama/v1//home/evl/jhwang47/SENSEI-Panama/v1/50Island.png: file not found.

It seems as though it is appending the working directory twice. Am I improperly using the filesystem in omegalib or is this a blender issue?

James Hwang

unread,
Jun 24, 2016, 5:03:17 PM6/24/16
to omegalib
I have tried running it like this as well
def loadModel(name, path):
    model = ModelInfo()
    model.name = name
    model.path = path
    model.optimize = False
    model.usePowerOfTwoTextures = False
    scene.loadModel(model)
    model = StaticObject.create(name)
    model.setEffect("textured")

Alessandro Febretti

unread,
Jun 24, 2016, 5:08:39 PM6/24/16
to omegalib
Try using this
model.setEffect("textured")
And in blender choose to embed the textures in the fbx file.

James Hwang

unread,
Jun 27, 2016, 3:13:22 PM6/27/16
to omegalib
Thank you for your help again Alessandro, my version of Blender does not have an embed textures option. I tried using Autodesk FBX Converter to embed the texture into the fbx file. The file size went up in size which indicates that the texture was embedded. I then tried loading it into omegalib only to receive the same error that the file could not be found. Are there any other settings that might be causing this?

Alessandro Febretti

unread,
Jun 27, 2016, 4:13:49 PM6/27/16
to omegalib
Can you send me a copy of your model here or on dropbox? you can send the link to my email address feb...@gmail.com if you don't want to share it here).

James Hwang

unread,
Jun 27, 2016, 9:33:48 PM6/27/16
to omegalib

Alessandro Febretti

unread,
Aug 8, 2016, 5:37:34 PM8/8/16
to omegalib
sorry, I never had the time to get back to this. Are you still having this issue?

James Hwang

unread,
Aug 16, 2016, 4:18:27 PM8/16/16
to omegalib
Yes I am. Sorry I didn't see that you had responded. I have been working on other things in the application without the mesh. I was thinking that maybe it was due to the FBX version, or maybe I might have to convert the FBX to ascii and delete the path information and then convert back to binary.
Reply all
Reply to author
Forward
0 new messages