Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
( 1)

Hi watabou,

is there amyway you can make it so that we can export the obj with uvmap and a flat image texture.

im trying to get your models to play nice with tabletop simulator, and even with blender inbetween its a pain as TTS does not suporrt mtl files. 

it would be fantastic if there was an option to download the obj with a properly mapped flat image texture so that the colours schemes can be determined and exported straight from your generator.

many thanks

Hi!

So if I understand correctly there are 2 issues, both related to using exported OBJ's with TTS, right?

  • Flipped normals when OBJ is first imported in Blender and then somehow imported in TTS. Some questions: Do you use OBJ or some other format to save in Blender and load in TTS? Do normals look wrong if you load an exported OBJ without loading it in Blender first? Do you need the Blender step for anything other than scaling a model? I know nothing about TTS but to me it looks like a problem of Blender-TTS interaction, because in three common application (Blender, 3D Viewer, Sketchfab) and one less common I have access to, normals look ok. Yes, this is probably related to the fact that there are many open meshes, but open meshes are not "bad" meshes. At this moment I wouldn't like to fix them - that's too much work (especially in case of Procgen Mansion) and too many triangles which won't be visible anyway. I can try to add normals data to OBJ explicitly, but I doubt this will help.
  • TTS does not support materials, so mansions look untextured when loaded. The problem is that I do not use textures in the generator, instead there are solid color for each triangle of the model. Generating a texture is easy, but assigning uv coordinates for each vertex is a bit harder. Maybe I'll implement it in the future.
(2 edits) ( 1)

Hi Watabou,
thanks for your reply, and sorry to ask you to do more work. 

to answer your quesitons 
Firstly I used a saved .json from MFGC reimported it into City Viewer and downloaded the .obj output.
if the .obj is directly imported to table top simulator the normals are wrong.



The additional blender step was simply me attempting to fix the normals fast and failing. However  after further investigation i think i may have been wrong in my initial post.

Either the normals of the basic .obj output are simply inverted, not random - OR its possible that as this was a new .Obj output file that the normals are different to my first file - you would  obviously know more about how your code is handling this.

here are the normals  of the same .obj after being imported to blender, luckily either with this model or in general, a simple flip of the normal direction solves the issue in TTS. It may be possible that the normals were further screwed up due to me recalculating them, rather than flipping all.

one possible solution to get an object straight to TTS or anything else that is having an issue would be for and option for output from (City Viewer) to have flipped normals? 

Procgen Mansion - the models seem to be fine or at least there are no flipped walls etc that I have seen.

Textures / materials

yes I'm aware of the MTL issues with TTS (its a great tool but its also janky as hell and rubbish in many ways) - the issue is currently to get a nice looking model, I have to unwrap the model, assign each different material to an image, then bake the render output to create the texture - its not the end of the world but its just an extra / unnecessary step when I'm wanting the colour output from your generator because it looks good that way :).

an added advantage of having some form of unwrap and basic texture file would be that people could "paint" the models very easily with other textures or materials in blender without having to unwrap the model assign then bake.

i did find this solution that is supposed to solve the .Obj Mtl texture issue.

 GitHub - theFroh/imagepacker: Takes a Wavefront OBJ with textures and attempts to squash them into a single texture file.

but unfortunately i could not get it to work for me :/ but maybe looking at it may be of some help ??


finally I just want to say ...

Thank you your generators are amazing and have helped me so much already I cant wait to see what you build next, an integration between MFCG and Procgen mansion perhaps...so we can get cities with all building mapped and models for all, ... one can dream one can dream.... ;)

Hey,

Sorry that it took me so long to reply to your detailed description of the problem. As I said, I don't specify normals explicitly in obj, they are derived from the vertex order. Yes, I can add an option to reverse that order. Or I can specify vertex normals and that will also allow me to implement smooth surfaces. I'll try both options next time I update City Viewer or Procgen mansion. Maybe I should buy TTS, it's not expensive...

( 1)

no problem :) thanks for looking into it for me, keep up the good work ! :D