Search Unity

Tree ... no valid mesh renderer

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

  1. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    My original file was a .obj. from fragmotion.
    When I take just the mesh, drop it into the scene it show nice. But when I try to use it as a paint brush tree tool, I get that message:


    The tree test4 couldn't be instanced because the prefab contains no valid mesh renderer.


    - I tryed a .blend (blender) file, got same message.
    - I tryed as paint detail mesh. Nothing show up too.

    Thanks
     
  2. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    Same error here, on a .blend file and a blend fbx export.
     
  3. jmunozar

    jmunozar

    Joined:
    Jun 23, 2008
    Posts:
    1,091
    Hello

    probably could be that the tree has no filter, the filter has no sharedMesh, or there is no renderer. have you checked this?
     
  4. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    I've tried this tree several times, I can add it as a painting instance but no image of it shows up in the painter. It has the filter and
    renderer, it shows up as a single item. Just to copy and paste the
    tree several million times would be bad for frame rate? |P

    http://terrymorgan.net/images/tree_unity_inspector.jpg
     
  5. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
  6. asterix

    asterix

    Joined:
    Aug 1, 2009
    Posts:
    245
    I have log a problem with Unity support, they sent me 2 email, they still trying to fix it.
    By the way if you go on the island demo and look closely some vegetation, you will notice a thin black line around each plane. I log a problem on that too, cause I got the same result. If we all log problems for those they will look it over.
     
  7. Veles

    Veles

    Joined:
    Feb 23, 2010
    Posts:
    21
    Is this problem solved?

    I have the same problem:
    When i want to paint trees (made in Blender)i'm getting horizontal position and message in the console :
    The tree TreeUnity2 couldn't be instanced because the prefab contains no valid mesh renderer.

    I tried with .fbx, the result is the same.

    I also noticed that my imported tree files has a prefab (child) in the prefab (parent), but trees from unity assets folder (Palm in this case) has only one parent prefab (marked in the screenshot). I tried to make child prefab (which contains all wanted components including mesh renderer) a parent, but i can't do that, and i dont know is this possible, since this prefab objects imports in that state directly from Blender..In Blender the tree is one mesh with two materials like it supposed to be.

    Also, when i add tree in the terrain tree paint menu in the inspector, the tree is not visible (marked in the screenshot)

    It all looks something like this:

     
  8. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Hi, welcome to the forum!

    Have you filed a bug report for this? It may have been logged already, but it is possible that it was missed last time.
     
  9. Veles

    Veles

    Joined:
    Feb 23, 2010
    Posts:
    21
    Thanks for welcome :D

    The thing is i searched about this kind of problem and i don't know exactly anymore is this a bug or not.


    Some people say this is all about coordinate system differences between 3D apps and Unity and we have to rotate objects in 3D app so Y axis points up for mesh objects...(which i must notice sounds rather stupid to do every time if you want to import something in Unity).So I tried to export tree (from Blender) pointing in different directions and the result was always the same (tree lays down always pointing to the left, Unitys Z axis) so obviously for me any kind of rotation does not work...

    So i don't really know is there a solution for this or is it some kind of bug?!

    And I thought painting trees in Unity would be so simple......
    :roll: :D
     
  10. Veles

    Veles

    Joined:
    Feb 23, 2010
    Posts:
    21
    Just to make this issue clear from my side...

    The problem was that i didn't know i have to use Apply transformation ( CTRL+A ) in Blender after i rotate my Trees axis, so that it fits Unity engine orientation. This solved painted trees orientation in Unity..

    But i still scratch my head trying to understand the reason why Unity use Y axis for up while all other 3D applications use Z for up. :)
     
  11. Kragh

    Kragh

    Joined:
    Jan 22, 2008
    Posts:
    657
    There's no real standard in regards to that. Some use left handed systems, some right. In some y is up, and in some z is.
    It's not like Unity is the first ever program to do it this way :wink: And normally when you work with x,y,z on paper in math, y is up axis. So I would rather ask, why some 3D programs initially chose to put z as up...
    But as a 3ds max graphics artist, I totally follow your annoyance in this issue, even though I blame 3ds max instead. I have just learned to live with it, and today I don't think about it at all...
     
  12. Orbital Fan

    Orbital Fan

    Joined:
    Mar 23, 2010
    Posts:
    3
    Hi - I've figured out how to add meshes as trees/foliage for the terrain editing (in case anyone else had trouble):

    Imagin you've just added your Blender mesh to Unity, you will end up with something like:

    Tree1
    __Tree1
    __Tree1 (Mesh)

    When you go to add a mesh to the tree-list in the terrain properties, drag this tree item from the Project window to the property (ie don't select it from the drop-down). The important bit is to NOT drag the parent Tree1 item, but just the child Tree1 (not the mesh).

    Hope that helps people out.
     
  13. jazzharris

    jazzharris

    Joined:
    Jun 28, 2010
    Posts:
    7
    I am new to Unity and just spent 3 days trying to get an evergreen tree (many trees) from Blender into Unity. I have been able to get 1 tree to import both by saving it as a Blender file and exporting it as an FBX file and place individuals on the scene but not paint them on as others have had problems with here. I tried your solution, but without luck. Any other ideas? I can't have a palm tree since my island is placed in the pacific northwest. This is the only place on the internet I have found related to my problem. Help! By the way. write slow, I'm new.
     
  14. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Hi, welcome to the forum!

    Does the problem seem to be with the import process or the creation of the trees? When you say you are having no luck with the solution, can you describe exactly what is going wrong for you?
     
  15. jazzharris

    jazzharris

    Joined:
    Jun 28, 2010
    Posts:
    7
    When I save a tree from Blender or export using FBX then put into unity I can place the prefab onto the scene. However, when I add the tree in the under Inspector/Terrain/Terrain (Script)/Place Trees/Edit Trees I just get a blank blue box instead of an image of the tree. When I go to paint the tree onto the terrain I get nothing. I have tried this with maybe 20 trees with every export setting under Blender, plus some trees I found with other formats without success.

    I have included the tree I have had the most success with plus an object that I want to have in an underwater scene I am working on. Any help would be greatly appreciated.
     

    Attached Files:

  16. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    I've tried this for hours and it looks like a blender export problem, because I can import
    the same tree into 3ds max 9 and get a paintable tree out of it, only it's lying on the ground,
    here's the max 9 file and the fbx, if someone could get it standing upright? It might be possible
    to use anything that makes an obj and 3ds file using the max fbx converter. It doesn't matter
    how I rotate it in max, or whether I check z is up , y is up in the fbx exporter, the trees are
    still lying down.
     

    Attached Files:

  17. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    shot
     

    Attached Files:

  18. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    K, I got it working, I loaded tree_dead_obj.obj into the fbx converter 2010.2, and asked for a
    destination format fbx 200900 save mode ascii. Maybe other apps that make obj's can use
    this converter also.
     

    Attached Files:

  19. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    Later: no other obj's would make trees, only fbx's I'd made in 3ds max 9 and
    then converted. Tried the latest fbx converter 2011.3.1, same result. This is really a bad bug,
    The only way I could get a tree to paint is to convert it to the 2009 ascii version, then it's 100 times
    smaller and lying down compared to the same tree as a regular model. Is there a big
    rendering difference between just copy/paste models and tree painting? I would want my
    trees to at least be rotated differently, tree painting looks bad compared to the grass painting.
     

    Attached Files:

  20. LaurieAnnis

    LaurieAnnis

    Joined:
    Jan 24, 2010
    Posts:
    63
    I was about to post here asking if anyone had any luck getting Blender trees to work in Unity at all because I thought I still wasn't seeing any result, until I remembered seeing the tiniest of speckles after painting the past few brush strokes. I had to use both Veles' suggestion to use Apply to the rotation transformation using CTRL+A in Blender after rotating my tree to point up along the Y axis as well as using Orbital Fan's suggestion to drag the "child" of my imported tree asset from the Project window into the Add Tree window.

    Right after I posted my question here, I went back and zoomed way way in, and sure enough, just as hike1 is seeing, my trees were in Unity, but they were so microscopic I had missed them. I threw in a Character Controller and pushed play, and it turns out they were about ankle high. Adjusting brush size even to 200 and scaling up the asset in Unity doesn't seem to change it. At least mine were upright thanks to Veles' suggestion. I was also able to fix the scale problem by going back into Blender and increasing the scale of my tree and also doing Apply to the scale using CTRL+A again. Changing the scale or rotation doesn't seem to "stick" between Blender and Unity if you don't do this step.

    Thank you all so much!

    Edited to add I exported from Blender to .fbx
     
    Last edited: Jun 13, 2011
  21. Rodesqa

    Rodesqa

    Joined:
    May 16, 2011
    Posts:
    181
    The Y axis is actually the proper axis. alot of other programs use Z axis based on other attributes of creating. If you look at any graph you will have Y representing the vertical axis, X representing the horizontal axis, and in game design Z which represents forward. Then you get to the nitty gritty with -Z , -Y,-X. These are all for game creation. i hoped that clearified some things up :]
     
  22. artician

    artician

    Joined:
    Nov 27, 2009
    Posts:
    345
    I'm still experiencing the same problem that started this thread. I have a number of projects where this wasn't an issue (successfully imported trees from 3dsmax, painted them on terrain, etc). In the project I'm currently playing with, I can't seem to import a tree for use with terrain painting without getting the error: "The tree <objname> couldn't be instanced because the prefab contains no valid mesh renderer".

    I am using 3dsMax2011.
    I have tried importing via the following formats:
    OBJ
    3DS
    FBX2011 binary
    FBX2011 ascii
    FBX2009 ascii

    Nothing has yet worked. Has anyone had any concrete solutions for this?
     
  23. rakeshmalik91

    rakeshmalik91

    Joined:
    Aug 16, 2014
    Posts:
    9
    I was having the same error
    It worked when I changed all shaders in the tree to "Nature/Tree Soft Occlusion ..."
     
  24. KEMBL

    KEMBL

    Joined:
    Apr 16, 2009
    Posts:
    181
    I had such situation on U5.1.1 and in my case, I had object like
    ObjectRoot (only transform component)
    Object child (mesh filter, renderer, etc)

    the solution was to make prefab from "Object child" only and use it.
     
    grrava and devon_j_hartman like this.
  25. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    5 years later, still no luck with the trees rotated 90 degrees. If I drag them into the scene they're upright rotation is x -90, but they
    appear lying on their sides as .mesh.fbx in the inspector, which means they don't paint in the Terrain painter upright.

    the solution was to make prefab from "Object child" only and use it.
    If you have 2 submeshes
    like this
    Tree_parent
    tree_trunk
    Tree_leaves

    You have to take the 2 meshes into blender and CTRL-J join, doesn't solve the sideways problem though.
     
  26. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    I have a 'homemade' blender tree painting in Unity Terrain, the trick is to check 'Experimental! Apply Transform' when
    you export the fbx. This tree was made with tree[d], you have to give credit but otherwise free, and the texture was
    from textures.com (was cgtextures) free also.
     
  27. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    It's not sideways either ;--}
     

    Attached Files:

  28. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
  29. devon_j_hartman

    devon_j_hartman

    Joined:
    Mar 19, 2015
    Posts:
    14
    THIS
    Thank you so much
     
  30. SarahRMS

    SarahRMS

    Joined:
    Dec 3, 2017
    Posts:
    1

    Thanks a lot! I finally got my tree in the terrain.
     
  31. Grumon212

    Grumon212

    Joined:
    Oct 28, 2021
    Posts:
    1
    So I imported an asset from the Unity store (Unity Particle Pack 5.x) into my project, and I'm having trouble using the prefab "Dripping Flames" as a tree. It's also been happening with some of my other prefabs as well. It's been giving me the same message: "The tree DrippingFlames couldn't be instanced because the prefab contains no valid mesh renderer." I tried adding in a mesh renderer, but that didn't help. Any assistance?
     
  32. - please do not necro old threads
    - please open your own thread, it is free, it's easier to help you if there is no noise of unrelated problems
    - you're using an asset which was intended for Unity 5.5. It's in the description on the Asset Store:
    - so, are you using Unity 5.5?