If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Exciting News: Chaos acquires EvolveLAB = AI-Powered Design.
To learn more, please visit this page!
New! You can now log in to the forums with your chaos.com account as well as your forum account.
Announcement
Collapse
No announcement yet.
Tool to convert opacity mapped faces into geometry leaves
I was wondering how tuff it would be to trace the leaf edge with a spline, if you sampled the alpha there wouldn't be too much data to consider, maybe..
that's just what I did. I just traced the alpha with a spline by hand, not too hard to do. depending on what kind of tree you have you can get away with only 4 vertex points, then converted it to a mesh, it doesnt need a shell modifier like da force said, because the vray mat renders both sides anyway.
the xfrog tree I used has allready 4 differt mat. ids for the leaves, that way you can replace it with 4 different colors too.
I'll add in support to replace multiple ids too. As far as the splne tracing thing, I think somene may have done this but I'm not sure whether it was in max or in a compositor as some kind of auto rotoscoping...
the more I think about it the more impossible I think it is, in maxscript anyways. It can be done in PS easily just convert a selection to a path. and of course any raster to vector proggy. Joost's method is sounding pretty good.
Okay I've re-done somestuff in this, now you can pick multiple objects to be the leaves to add a little more variation. On second thoughts, the assigning of ids via the script may be a bad idea especially if the leaf object you are using already has multiple object ids - for example we're doing something where we have an object with leaves and apples in one object so it'd be a pain in the ass if the apple objects accidentally got a leaf material id etc.
Also, one of the guys here is having problems with memory overheads on high poly leaf objects so I'm gonna do another version which rather than outputting a huge bit of geometry puts out point helpers with the position and orientation of the source leaf which may be a little lighter. I've got another script to replace one object with another to swap them over to complete the process.
Appreciate all the work your willing to share with every John, very generous of you.
I'm curious as to the correct method of working with your script. I am testing it with an XFrog plant, and it appears to be creating a leaf object placed at the center of every face on the target object, which is fine in itself. However, the plant I'm working with has multiple faces for single leaves, so the script is over populating the object.
I guess a request would be to have it replace at the poly,element level as well. Or maybe I'm just doing it wrong
Again, thanks!
EDIT I just figured out that it's based of off visible/invisible edges. Works like charm, thanks!
Yeah it's a little thick really and works on the assumption that one single polygon is each leaf object - all of the max aec trees that I set it up for use a single face and an opacity map - the opacity map adds 3 leafs to each face so you need to replace one face with an object that has 3 geometry leaves so it's geared towards that type of situation. Support for element level is a very good idea though for situations like xfrog or otherwise - I'll add in an option to run from either or possibly off selected elements.
I'm still on max 7 in work - we havent had any down time since max 8 sp1 came out so to be honest I haven't tried it. The only thing I can think of is that it installs itself as a macroscript under "John O'Connell tools" in the main ui category of customize ui. I'll take a look at it this evening though to make sure that it behaves properly.
Just be careful using really high poly leaf objects - we've tried it on an aec tree that has 11000 leaves and were replacing them with a new leaf that had around 150 polygons (it had to replace an opacity map that had three leafs on it) and we had a few out of memory errors. I'm trying to work on quicker more efficient methods bu be careful in the mean time
yes i will thanks. but i have a lot of trees in a scene at the moment, which renders veeeeery slow with opacity map, i've made proxis, and all the textures crashes. so i hope it will work without any opacity map.
Comment