A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by larsbertram1, Aug 19, 2014.
))) I was experimenting with something similar a few weeks ago Nice work!
Okay. That is one feature that I can not wait to try out. AFS 4 is coming along great so take your time. Do not mind waiting for awesomeness.
Thanks. Yeah this is the first time I tried this script with a non-tree object. Worked like a charm. Looking forward to trying rocks and overhangs with ivy that moves in the wind. How did your experiments go?
It went well, but it was just testing for non-tree objects. I spent more time (but not too much) on trying using test trees with the terrain, but had no luck with billboards yet as they were black (needs more testing).
Strange. As long as the trees are using the tree creator shaders they should billboard correctly. When I first started in Unity 5 my tree billboards were dark. Do not remember exactly but it might have been enlighten. Are you using the GI?
I think it was in Unity 4. I will test it again when I will have time.
i currently shifted my project to U5 pro , and had custom importer prier to it , i have so many trees for import but the shaders seems to have some issues with U5, is these shaders are related to AFS? and will be updated when i update to ASF4.
Lars is working on AFS 4 for Unity 5 but until then you can grab the U5 built-in shaders here:
Once downloaded go to builtin_shaders - DefaultResourcesExtra - Nature - in the nature folder you will see the TreeCreator folder. Delete the treecreator folder that is in the Custom Tree Importer folder in your project and copy the TreeCreator folder from the built-in shaders to that place. It should work fine now. Then when AFS 4 comes out you can change the shaders over to that awesomeness.
So is this asset working with Unity 5?
I realy want to buy it if so.
Until it is updated make sure to replace the shaders like I said above. Other than a quick shader folder swap it works great.
just a quick update on the upcoming version for unity 5 and baked pivots which will allow us to have some leaf tumbling:
That looks soo cool!
I have tried using this asset, but the manual was to complex for me. Is there any video tutorial on making a custom tree with this asset?
I have Xfrog and can make some nice custom strees. Now I only can import them as static meshes.
I do not think there is any yet. I am very slow when it comes to understanding instructions so I read the manual over a lot. Is quite simple once you get it. I do not know how advanced you are with design but I find the difficult part to be understanding your modeling program. Best thing to do is find what you do not understand in the Custom Tree Importer manual and do a search on google with that instruction on the 3d app you use. For instance 'How to parent objects in Blender?'. I actually never parented anything before using this script so that was something that helped me.
Thanks for the mini-tutorial for blender exports, I can't quite get it working though. May I ask:
What did you mean by: ''set all your edits(xw, xt, xp)''?
The problem I have is that when I import the .fbx, the model appears in the asset view as on it's side. Then when put into the hierarchy and scene, it is broken up and rotated strangely. The mesh is also deformed.
I have the pivots set correctly, I have the trunk parented to the root, the branch parented to the trunk, and the leaves parented to the branch. The shaders apply correctly, and the meshes do move in play mode. It must be something to do with my export..
Hey. The model has to be rotated 90 degrees on the x axis but still standing normal to export correctly.
From my previous post:
- If not already done rotate the model so blender will export it correctly. Rotate the model in edit mode negative 90 on the x axis - leave edit mode and rotate the model 90 on the x axis (make sure to rotate it with the pivot being the 3d cursor,Shift+C to move the 3d cursor to 0,0,0) After this is done the model rotation should show x90, y0, z0.
Not sure if there is another way to export it correctly without doing this. Can be annoying if you already have the model broken up. If this does not work let me know and I will get back to you in a few hours.
Yeh, I followed your instructions as best I could, including doing that, but alas, still not working.
Also, no matter how I rotate it - once imported, when I switch between local and global rotation in Unity (with 'x'), it always switches I suppose I'm just missing something key..
Would you be willing to talk on Steam or something about blender in general? I can't help but admire your work, but realise you may be pretty busy.
Started a conversation with you. Can hopefully help you easier.
I am not the best talker. I do plan on maybe doing some tutorials but I am not an expert. Still learning things everyday.
Hi there Lars,
Im trying to test your Demo Scene in unity 5.1.2f1, and seems that the scene is not working. Dragged the modified Trees into the scene setting materials to "Tree creator Bark optimized Tumbling" and "Tree creator Leaves Optimized tumbling" and they are bending when I hit play, but without any sync with the Wind Zone.
I can remove Wind zone and they still get the same animation, I can set the wind zone strenght to 1000 and there is no difference.
I have Advanced foliage Shader in the same project, there is any conflict with it?
just tested it with unity 5.1.2f1 – and it works fine.
but you have to import the package first and then reimport the trees as the tree importer script does not work when importing package as it is just not present.
custom trees work for me even after importing afs. and they still work when adding the afs setupscript to the scene.
sorry, but i have no idea what is going on there.
But they work with Wind Zones (they are sync with them )?
Cause as i said, they are working, but not with wind zones.
EDIT: Removed Wind Zone and added it again. Now its working.
Thanks for the fast support. Can I ask you to point me in some more direction? I'm doing what your manual says about doing first tests, and im building a simple Tree with only a trunk and a few branches (or leaf). The results are pretty bad (no main bending at all). Can you download the Tree fbx and say me what im doing worng? (I think the heriarchy and pivots are ok, but maybe there is something worng).
Download Link: https://dl.dropboxusercontent.com/u/72551597/Plantas_Bosque_5_afsTREE_xlb21_xlprl.fbx
Hey. There are two things I did.
Fixed the rotation so it is upright and rotated x90 so it remains upright in Unity.
The previous fixed part of it but it still did not have a UV2 and was not bending besides the leaves. Not sure what modeler you are using but I recently moved to Blender 2.75a. You had the hierarchy and pivots right so the only thing I could single out was the export. I moved the model back to Blender 2.74 and exported the SAME model and it worked. Created a UV2 and has main bending. So unless it is just me Blender 2.75 is doing something different that does not work with Custom Tree Importer.
So here is an export that is working for me: test_afsTREE_xlprl
Wow Baldinoboy, really thank you!
So seems there is a problem with blender 2.75a fbx export because I tested before the rotation method. I will have to go with 2.74, but all my plugins I have to edit vertex colors and combine layers.... ahhhhhh hope they will work with 2.74.
By the way, with your custom tree importer is posible to use combined trees?
Really thank you for your support on all of your assets, as soon as I can test with 2.74 I will write a nice review!
Your welcome. Did not notice this problem before you brought it up. So your mentioning the problem probably saved me a few hours of hair pulling later on. So thank you.
You can still create the tree in 2.75. Setup vertex colors and everything. Just export it and import into 2.74. Then once again export it and it should work.
Not sure about the multi trunks. Never tried. Lars will have to help you there. Would come in handy with some trees. Especially bamboo.
Thanks for the find. Noticed the Experimental Apply Transform button but it does the same thing as previous apply transform and deletes everything but the trunk. Did not notice the Apply Unit. Love how they default these new options to on. The scale for me is fine. In Blender it is 1.47m and in Unity is 1.47m at an import scale of 1. Thank again for the find.
Hi there Baldinoboy,
Testing further, now I can say that solving the problem about main bending its a little more tricky than only disabling "apply unit" checkbox from export.
There is a tricky part about applying rotations:
1. Apply transform (rotation and scale) for all parents of the Tree Hierarchy (all should be at 0,0,0 rotation now).
2. Select the "empty" root.
3. Rotate X -90º.
4. Apply transform only for the empty.
5. Rotate the empty X 90º.
6. Check that the only element of the tree that have X rotation 90º is the root "empty". All other parents should be at 0,0,0.
7. Done, ready for export.
(Remember to disable "Apply unit" and "Apply Transform" at export)
I will delete my previous post, because this is not a thread about how to solve problems of blender 2.75a with Custom Tree Importer. But I think that this post is important for other blender users working with Custom Tree Importer.
Yeah. I noticed that just the root needs to be rotating. I was rotating every part of the tree x90 but I guess it all builds to the root when going through the custom tree importer. In the .fbx I attached everything but the trunk is rotated x90. It works fine exported from 2.75 once you disable Apply Unity. Thanks again for letting me know about that. Probably would have never noticed that new option.
Hi Lars and Co.,
I have been eyeing off this utility for a while now as i purchased over 300 trees from Xfrog. I have since tried to find modelers who could lower the poly count with LOD etc. with no luck, they seem to think it is about $100 per tree in work.
My question to you is are you familiar with Xfrog 3D trees and have you imported them before into Unity with Custom Tree Importer?
The models come in .OBJ (amongst many other formats) so i have simply loaded them and changed the orientation on the x to -90 so they are upright and set the leaf and bark to the appropriate Tree Creator shaders... and they are beautiful! Here is a screenshot of an entire species (9 trees of various ages) of a Teatree...
here are some free samples from their site http://xfrog.com/category/samples.html if you or someone else would like to try!
So one major problem is the poly count is about a million (or 30,000 or something per tree)... I know your other asset can do billboarding very well so i'll likely grab that and see if i can get away with these trees as is...
How ever i really want them to be affected by a WindZone and i'm no animator so just like to know if it'll work as is also what you think about your Advanced Foliage Shader working with these trees, these tree should be affected by walking through them (smaller ones) and the bigger should probably shake if you hit them ideally.
i have not imported any xfrog tree yet - but 30.000 polys per tree seems way too much.
i know that far cry 4 even has up to 50.000 ploys on LOD0 but that is a custom engine...
so my advice would be to keep the polycount bewteen 2000 and 5000 max as unit’s tree creator trees do not sopport LODs (unlike speed trees).
and as the billboards all share on single texture you won’t be able to add a vast amount of different trees to your terrain as the texture resolution for each billboard will decrease with any prefab you add.
so 5 to 10 different trees might be the max.
(you may however use multiple terrain of which only one gets rendered).
I just loaded the tree second from the left (the biggest one) into Blender and it says it has 185,000 tris.. oh damn.
Can you explain what you mean by the resolution for each Billboard will decrease with any prefab you add? I'm not sure i understand that bit.
10 different trees is not too bad if it is per terrain, assuming my terrain made up of 16x16 terrain chunks is considered a terrain each.
But you do also mean that the same tree has the same billboard so if it's rotated differently it will still pop to look all the same? i was under the impression your billboards took a fresh snapshot depending on the trees orientation to the camera? - I'll have to check your demo out again.
Each prefab you add adds its own billboard image to the one billboard texture that the terrain system creates. It will not increase in size or create new textures for more trees. So when you get to a few trees the billboards start getting horribly blurred. So if you want a varied natural environment Unitys terrain system will throw a tantrum. That is how I see it at least .
I am trying to get this script to work, but still struggle at the moment. I have a simple test tree, brought to Untiy as *c4d. You can see the result on the right.
Importer sets the two shaders to Tree Creator Leaves/Bark Optimized.
A modified mesh is generated, the preview looks fine (and says 2submeshes, uv, uv2, colors) except it is without material/shader. When dragging this version into the scene, I get a pink trunk without leaves. Inspector only lists one empty element under materials.
Also tried to go via FBX and also via Blender, in all cases I only get this pink trunk.
Console seems to be fine, no error message (apart from missing Vertex Colors when using the Cinema4D File)
The mesh uses a hierarchy, pivot points work fine, no tags used so far. It seems that I am doing something wrong
What you need to do is drag the imported mesh and not the modified mesh into the scene. The script creates the modified mesh and inputs that mesh into the imported object. Here is a simple image.
If the import mesh has problems too then it is a setup issue. It should be a single object without any children when moved into the scene. So if it is bending nicely just setup correct materials, textures and input them.
oh man, thanks a lot - this was really a stupid error I did.
It works as you say, now I need to figure out, if it is better to use Cinema4D, or go the route via Blender (because of Vertex Painting)
Awesome. Glad it is working.
Have not tried Cinema4D but I do know Blender is annoying to vertex paint. I use workarounds like making a texture where I paint the uv edges green and then bake to the tree using the Bake to Vertex Color option. It is quite easy once you get used to it but if Cinema4D has a more useful approach to vertex painting that is the way to go.
by the way - thank you also for your freebie scripts!
Thanks but I am not the dev. @larsbertram1 is the developer of this asset. I am just a very happy user .
I'm having 3 problems with the tree creator, I followed your tutorial from 2011. The 1st is I can't get this
texture to UV map correctly on the trunk, 2nd-I can't make unique prefabs out of these trees even if I duplicate
in project view and 'break prefab instance', all the trees get the new materials. #3 is I can't import a unitypackage
of a tree with the mesh, it says it's in the prefab but it's not. Is your importer any use here?
the custom tree importer is written to import custom meshes.
unfortunately it won’t fix any problems on trees created using the built in tree creator.
1) Do you have your bark texture Wrap Mode set to Repeat or Clamp?
2) Duplicating the tree prefab in project view and then dragging that one out to edit should work. Just tried it out and it worked fine.
3) Sorry. Not sure on this one.
Purchased, but I'm getting a "missing prefab" in the demo scene.
Have you re-imported it yet? I skip importing the demo scene so not sure. Will try it out.
Hey Lars and thanks for making this great plugin. Does it work with trees that have their branches and leaves in the same submeshes?
Sorry if my answer is not clear, I am 3/4 asleep .
You export the tree with every leaf, branch as its own object. The two submeshes will be selected based on the texture, material applied to that each object. bark and leaf. So the script will create the two submeshes that will shade and bend correctly if setup correctly. So that conifer branch should be set as a leaf so it has translucency and with a darker green vertex on the edges will bend nicely.
Thanks @Baldinoboy. I was able to import my tree using the custom tree importer with no errors though it's not yet responding to the wind. I haven't added any green vertex colors to the tree yet.
Cool. You do not need the green vertex colors for the tree to bend. Just for the addition of edge bending. Couple things
When imported did the script create a _modified version of the tree next to the original import?
Do you have a windzone in the scene?
I do indeed both have a _modified mesh and a wind zone in the scene. Perhaps it has to do with the fact my tree doesn't have any branches? (here's a picture of a copy of the mesh before the mesh importer does it's magic)
Nothing has to be named branch. The only name you need to have is root for the empty object the trunk is parented to. I am thinking trunk too but think I have a few plants that have no trunk naming.
I could have used this tool a few weeks ago! Looks very helpful as I had a bit of trouble setting up trees for the first time.