Jump to content

Blender model isn't rendered on bjs


royibernthal
 Share

Recommended Posts

I have a blender model which seems to have been exported to .babylon with no errors (1 warning regarding no active camera which can be ignored).

It is not rendered when I try to load it into bjs. On blender everything seems fine - model, texture, rig, animations... What am I missing?

If you'll change the model variable in the PG from "sheep" to "croc" you'll notice everything works well, thus eliminating the possibility of a script malfunction.

 

PG: http://www.babylonjs-playground.com/#1SVN3I#23

.babylon: http://runeslots.com/misc/sheep/sheep.babylon

.blend: https://www.dropbox.com/s/jf71nao8qbtwumz/sheep.blend?dl=0

Link to comment
Share on other sites

Glad people are having fun on this thread :)

Yes the "alpha" value in the.babylon file is wrong. But it does not answer why:o. And what are all those 858 vertices?:unsure:

And before you say it - it is not @JCPalmer's  exporter!!!

Looking at the .blend file - it looks like the original file was an .fbx file imported into Blender.

Can you post the the original - file it came from???

More tomorrow.

gryff :)

 

 

Link to comment
Share on other sites

Nice observation Wingnut :)

gryff Don't worry I didn't think it's the exporter's fault :) I understood a while ago that the problems are always in the .blend files.

 

It's a model I purchased, so I have no idea why things are the way they are. I got the .blend as it is as well I didn't convert it myself.

I don't have the .fbx for this .blend, but here're the .fbx and .blend of a different model in the bundle I purchased which is likely to have the same issues.

 

The texture was originally a .tga, which was converted to a .jpg, is it possibly the reason behind the alpha issue?

 

.blend: https://www.dropbox.com/s/q9etjyqcvvjta2p/cow_blender.Blend?dl=0

.fbx (original apparently): https://www.dropbox.com/s/0mivad9eh3pdn16/cow_fbx.FBX?dl=0

.jpg texture: https://www.dropbox.com/s/moaq6p6vdxfy7j5/cow_01.jpg?dl=0

.tga texture (original): https://www.dropbox.com/s/m64mzfsly4wdkql/cow_01.tga?dl=0

Link to comment
Share on other sites

@royibernthal : I have spent 3 hours this morning looking at your files.

4 hours ago, royibernthal said:

fbx and .blend of a different model in the bundle I purchased which is likely to have the same issues.

Yes indeed. Can't even load the .fbx file.:wacko:

Will post again when I have the issue clearer in my head.

gryff :)

Link to comment
Share on other sites

@royibernthal : Ok here is the blend file- hopefully laid out so that we can walk through it. Don't change the window layout until after you have been through the items below.

I converted the .tga file to .png and then packed it into the blend file.

cowbase.zip

Unzip it and open the .blend file in Blender. You will notice I have added some items - a textured cube, a hemi and a camera (the latter two so that you can use the Sandbox).

Changing the Mesh

Step 1. Right click on the cow mesh note the outline colour - green (more on that later).

Step2. Go into "Edit Mode "with the cow mesh still selected - again note the colour of the edges - light blue. This means that all the edges of all the triangles are marked as "sharp".  No idea why.

Step3. Go back into "Object Mode" and click on the wrench/spanner in the Properties Panel. You will see two modifiers - the top one is "ms3d smoothing group" and uses the "sharp edges" but the end result is anything but smooth.- it is that faceted look.

So now we start making changes 

Step 4. Delete that modifier (Hit the X button)

Step 5. Go back into "Edit Mode" and make sure all the vertices are selected (use A key)  then go Mesh->Edges->Clear Sharp.

Step 6. The edges will now all be a red colour - that means all the edges of all the triangles are marked as seams. So, Mesh->Edges->Clear Seams

Step 7. With all the verts still selected go Mesh->Vertices-> Remove Doubles. Now go to the UV Editor Window make sure all the verts are selected (use A key) and go UVs->Weld/Align->Remove Doubles UV

Exporting The Mesh

I would export the mesh before you make the above changes and after. You will not see the cow only the cube. To see the cow, in "Object Mode" make sure the cow is selected then select the Material Tab (pink sphere) in the Properties Panel and scroll down to "Transparency" and check the box. Now set the Alpha value to 1.  Re-export - cow will show up. If you do this before and after making changes you will be able to view vertex count.

Now you will have noticed you do not have to do this latter step with the cube! And that puzzled me for a long while. For my best attempt at an explanation with the cow selected go to the Mesh Properties Tab (the little triangle) and scroll down to the Custom Properties, click the arrow so it opens up the settings then click "Edit" to view what it is changing.

You will see something that look like:

{'transparency_mode': 0, 'selected_group_index': 0, 'joint_size': 0.009999999776482582, 'alpha_ref': 0.0, 'groups': [{'id': 153318623, 'name': 'Group', 'flags': 0, 'comment': ''}], 'name': 'cow.ms3d'}

I am not a programmer, so I have no idea what this custom code is doing, but note the word "transparency_ mode" and "alpha_ref" appear. It is in some way maybe setting some kind of  over ride on the mesh.

'Well enough for now.

cheers, gryff :)

Link to comment
Share on other sites

@gryff Great work! Thank you for all the effort!

That's one messed up blender file you managed to fix... Do you still suspect all this mess was caused by a file conversion from .fbx to .blend?

 

Regarding Custom Properties, make sense.

I tried to remove it and then export, it didn't affect the transparency.

It's possible that I removed it after it had already been applied to the model so removing it now had no effect at all.

 

I tried applying everything you did to the sheep model as well, worked like a charm. Hopefully there'll be no surprises with the other models.

Link to comment
Share on other sites

@royibernthal : Well the sheep is the same - it has that Custom Property. So if this is the pack you bought I imagine all of them are :o

My attempt to import the cow fbx caused an error - seems to be an older version of fbx.

Below is an image of a rig of two humanoids: A is an imported fbx and B is a rig created in Blender. Notice how all the bones in A are all linked by dotted lines - very similar to your cow rig. The Blender rig has far fewer - and bones are connected mainly 'head to toe". That makes me think fbx->blend conversion.

As for removing that Custom Property - the methods I've seen involve using scripts. I'm not going there ;)

And just a comment. The mesh rigs I've seen you using lately are varied in scale. From the scorpion 80x a BJS unit cube to the cow 1x a BJS unit cube, and the dinosaur in between. You may say - well I will scale them in Blender - but if you want ti use the animations and they have translation/position changes as part of the animation, those position/translation animation values won't scale. I will involve work.:o

cheers, gryff :)

rigs1.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...