Search Unity

How to create my own "detail mesh" and paint it on

Discussion in 'Editor & General Support' started by asterix, Aug 28, 2009.

  1. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    I have some .obj models, but I can't get them painted on the terrain, anyone have done it?
     
  2. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Cant get them painted?

    I think you have to create a texture for the object and do UVWrapping of the model, I'm not sure/not aware of that you can paint models in Unity :?
     
  3. SarperS

    SarperS

    Joined:
    Mar 10, 2009
    Posts:
    824
    No, I think he means painting the model as detail mesh on terrain, like trees, stones etc.

    You have to give more details, why can't you paint them on terrain? An error shows up? Do they render with glitches? etc.
     
  4. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    There is no error. I choose the model, then I try to paint it like trees or grass as detail mesh and nothing show up.

    Also with that same model, I can place it one by one if I drag it from the project panel.
     
  5. Peter Hutton

    Peter Hutton

    Joined:
    Apr 15, 2009
    Posts:
    39
    Are you using 3dsmax ?
    If thats the case, I found this problem too. (I think it´s Max exotic coordinates system again)

    Could not see my custom trees until I realised
    their pivots gets wrongly oriented when used as
    a detail mesh/tree. (lying on the ground)

    But if placed as an normal stand alone gameobject the pivot is right.
    I think this is bug.

    How to fix:

    In 3dsmax change the viewport either left or right, doesn´t matter

    Select your tree

    From hierarchy panel

    1.-> affect pivot only
    2.-> angle snap on
    3.-> rotate the pivot 90 degrees clockwise/cc if rightview :p
    4.-> Do NOT reset Xform (or you have to do this again)
    5.-> export
    6. Paint your custom trees :)

    Hope this helps !

    Cheers
     
  6. lakru

    lakru

    Joined:
    Feb 19, 2008
    Posts:
    116
    The problem could also be the size of the objects. Try to change the scale in the FBX importer.
     
  7. Peter Hutton

    Peter Hutton

    Joined:
    Apr 15, 2009
    Posts:
    39
    @Lakru, Yes :)

    In 3dsmax change the units as:

    Display Units Scale : Meters

    System Unit Scale : Centimeters

    and you´re good to go !

    Edit:

    And remember to scale your *.obj model as well.

    Cheers
     
  8. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    I have blender.
     
  9. Peter Hutton

    Peter Hutton

    Joined:
    Apr 15, 2009
    Posts:
    39
    OK, have you tried exporting simple things like primitives ?

    Create a cube, -> do your Blender magic

    Whambam ? :)
     
  10. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    Ya I imported a flower, some kinda 2 planes with a image of a flower, with a transparent background.
     
  11. Peter Hutton

    Peter Hutton

    Joined:
    Apr 15, 2009
    Posts:
    39
    Yea, but try some REALLY simple primitives (cube, ball) without any transparency etc. just some plain texture.

    The glitch could be in texture , or in the *.obj geometry, just systematically eliminate all possibilities what might be causing this.

    Also have you checked that the texture is power of 2 ?

    E.g 128 x 128, 256 x 256, 512 x 512 NOT 550 x 245 ?
     
  12. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    (all my textures are x2)
    Ok, here is the result.


    - Created the unity primitive cube, worked.

    I tryed a cube.
    - Export .obj Fragmotion= Unity crash
    - what was created in Frgmotion, imported in blender. Export .fbx - Don't show (no crash)
    - Same in export .fbx - same result
    - Created a cube in blender export in .blend - don't show.

    Conclusion blender dose not work well on that part with detail.

    Did some other test with blender, exporting in .3ds and it work. Kinda weird. The mesh that look ok (before.jpg), but have seams :( show really tinny in detail mesh, and they are not as nice (after.jpg).
     

    Attached Files:

  13. Peter Hutton

    Peter Hutton

    Joined:
    Apr 15, 2009
    Posts:
    39
    Sounds like an exporter bug to me.
    Same quirk as the using 3dsmax made objects as tree/detail
    brush (this darned pivot flipping thing).

    Too bad :(
     
  14. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    I use tree magic, same as Plant life. If I export direct the .obj in blender OR Unity, upside down. The way I got the upside down to work is by importing the .obj into Fragmotion (free, but you can encourrage the guy 30$), then RESAVE in .obj. Import in blender, voilà, the mesh show properly.

    But my other problems are not solved.