Viro: FBX conversion script not working - "Unexpected file type"

Created on 13 Oct 2017  路  13Comments  路  Source: viromedia/viro

Thanks for all the hard work on getting Viro into our hands! I'm very new to the whole VR/AR scene and may not be going about this the right way, but I have recently obtained an FBX model located here: http://tinyurl.com/y7pfjcv2

When I try using the conversion script from the bin directory as shown below...
./ViroFBX js/res/heli.fbx js/res/heli.vrx

I get the following response:
2017-10-13 14:56:22.970 ViroFBX[7153:681045] "Loading file [js/res/heli.fbx]"
2017-10-13 14:56:22.971 ViroFBX[7153:681045] "Call to FBXImporter::Initialize() failed"
2017-10-13 14:56:22.971 ViroFBX[7153:681045] "Error returned: Unexpected file type"

Is there a certain type of FBX that is not compatible with viro or is this some other sort of error? Any guidance would be much appreciated!

Most helpful comment

Hi @tedjames,

I think your problem may be that the path to your fbx file is incorrect.

Assuming you didn't change the directory structure, if you're running the ViroFBX tool from within the /bin directory, the correct filepath to the file in theres directory should be ../js/res/heli.fbx. So the correct command should be:

./ViroFBX ../js/res/heli.fbx ../js/res/heli.vrx

Let us know if that didn't work!

Andy

All 13 comments

Hi @tedjames,

Interesting issue, it seems to work for us. (Here's the converted file: https://drive.google.com/open?id=0B_Us2lcUyRxPSVpSTkJtMkIzVEE)

What OS are you using?

Thanks,

Andy

Hi @tedjames,

I think your problem may be that the path to your fbx file is incorrect.

Assuming you didn't change the directory structure, if you're running the ViroFBX tool from within the /bin directory, the correct filepath to the file in theres directory should be ../js/res/heli.fbx. So the correct command should be:

./ViroFBX ../js/res/heli.fbx ../js/res/heli.vrx

Let us know if that didn't work!

Andy

Thanks Andy! That just about resolved my issue. Really appreciate the quick response 馃憤

No problem, glad I could help!

Let us know if you run into any other issues!

Andy

Hey Andy,

Sorry to bother you again, but I seem to have run into another issue. I'm working with a new fbx file that came with a png texture and a mat file. I've successfully converted the model to a vrx file but am unable to render it in my scene. The other heli.vrx file also didn't render and so I decided to try a new one.

Here are the associated files (fbx, converted vrx, png texture): http://tinyurl.com/yczbn4oj

And here is my code: https://github.com/tedjames/viroGame

I suspect this has something to do with the fact that these assets were made to be used specifically in Unity. Really not sure how to proceed at the moment.

Hi Ted, you need to add lights to your scene to make OBJ/FBX appear. Below I added directional light and ambient light into the scene and both objects appeared. I was unable to get the general to texture correctly. Would it be possible for you to send over the original FBX file so I can take a look at it. Thanks

<ViroScene>
        <ViroDirectionalLight color="#ffffff" direction={[0,-1,-.2]}/>
        <ViroAmbientLight color="#ffffff" intensity={200}/>

        <Viro3DObject source={require('./res/modelsUpdated/SimpleMilitary_Characters.vrx')}
            position={[0.0, 0.0, -2]}
            scale={[0.005, 0.005, 0.005]}
            type="VRX"
            resources={[
              require('./res/modelsUpdated/SimpleMilitary_General_Brown.png')
            ]}
          />

        <Viro3DObject source={require('./res/modelsUpdated/heli.vrx')}
            position={[-2, 0.0, -2]}
            scale={[0.3, 0.3, 0.3]}
            type="VRX"
          />
        <ViroText text="Hello World!" width={2} height={2} position={[2, 0, -2]} style={styles.helloWorldTextStyle} />
      </ViroScene>

Aha, that'll do it... as for the texture issue, reference this link for the original fbx, texture, and material files: http://tinyurl.com/yczbn4oj

Thanks!

Hey guys,

Just noticed that the 'Take 001' animation is not working either. I see that during the conversion process that skeletal and keyframe animations are being exported but when I go to run them with the following prop set to my Viro3DObject component...

animation={{name:'Take 001', run:true, loop:true, delay:1000}}

Nothing actually happens. Sorry to bother you guys so much with this. Just trying to understand some of the fundamentals here so I can get to the real fun :)

Update: I was able to get the animation working for "SimpleMilitary_Characters_NewRig.vrx" but it's a rather odd animation. Not so sure if 'Take 001' is supposed to behave the way. I was under the impression that these assets I'm working with came with several animations (run, jump, crouch, etc).

I didn't want to upload all my assets publicly so I've invited you and Andy to a private repo which contains them. That folder includes additional fbx files that might give us some more context around how these assets are supposed to work.

https://github.com/tedjames/viroGameAssets/invitations

No problem ted, happy to help. Are you running the animation on SimpleMilitary_Characters_NewRig.vrx or SimpleMilitary_Characters.vrx

SimpleMilitary_Characters_NewRig.vrx has an animation called "Take 001" and I was able to animate using your code. It is a little wonky in the middle section and we are going to look into that. But SimpleMilitary_Characters.vrx does not have any animation.

Re: Texture for the general. I ran the file in 2 other programs, FBX Review and Blender and neither one showed a textured general with that png file. All showed just a grey model. There might be an issue with that particular FBX.

If you are looking for assets to try out, we have some free ones on our documentation -> http://docs.viromedia.com/docs/assets#3d-objects

We will be adding animated 3D object next week.

Cool, I'll try opening up the other assets in Blender and FBX Review later tonight or tomorrow to see if they have textures. Not sure if it's of any significance but to my understanding, these assets were animated using Mecanim in Unity.

I'd like to close this issue for you guys but before I do, can someone clarify or link me to some resources/documentation on how to properly format/export fbx models with animations from Blender? Is there are a particular export method or set of parameters required to ensure that all animations are functional within Viro?

I've come to the conclusion that the assets I've been working with were either animated using Mecanim (which may not be supported by your platform), were exported in a format unsupported by your platform, or are corrupted in some way.

I plan to make my own assets within Blender and want to make sure that it's built in animation tools will enable me to properly export my models as fbx with animations compatible with Viro.

Hi @tedjames,
We aren't too familiar with Blender or how the interface works, but in general if your fbx model w/animations show up in FBX Review, then it'll work on our platform. The link to FBX review is here: https://www.autodesk.com/products/fbx/fbx-review

If you find a export process in Blender where your models and animations show up in fbx-review then you should be good to go. If your fbx files works in fbx-review but does not show up in the platform then let us know as it should work. Don't forget to convert your fbx files to vrx before using them :)

Cool, that works. Thanks for helping me out!

Was this page helpful?
0 / 5 - 0 ratings