Script request find geometry and replace with component
-
I would love a script that allows - I'll just do it by example as it is easier to explain:
- I import a tree generated by Onyz or similar,
- separate leaves into one group (as all geometry is loose),
- I select one of the leaf plates and select to make a component of that geometry and search and replace all similar geometry with a copy of this new component which would be located, rotated and orientated to suit the geometry being replaced.
The aim is obviously to speed up the use of detailed trees etc imported into sketchup and further to allow the editing and texturing of the leaf plates via a component.
I certainly feel this could be a proprietary script given the great advantages within sketchup!
Any takers!!
Cheers, Richard
-
Got to bring this back up for some attention PLEASE!!!
-
The biggest challenge is identifying the geometry for a leaf. My first thought was that if the leaves all have a surface area that is similar, it could make finding them a lot easier - you could find them by area.
Can you post a sample skp of an imported tree?
Maybe we can get you half-way there, if not all the way.
-
@jim said:
The biggest challenge is identifying the geometry for a leaf. My first thought was that if the leaves all have a surface area that is similar, it could make finding them a lot easier - you could find them by area.
Can you post a sample skp of an imported tree?
Maybe we can get you half-way there, if not all the way.
Thanks for responding jim!
I can't load up an onyx tree due to the user agreement, though the same effect would be buy grabbing any SU tree with component leaves and exploding down to base geometry.
I would imagine the script would either search for alike areas or simply alike geometry. The script would only need to locate one similar face and then select all connected and replace!
I would imagine the script wouldn't be so hard to do but could be a great time saver where ever a model contains numerous instances of the same geometry.
-
@richard said:
@jim said:
The biggest challenge is identifying the geometry for a leaf. My first thought was that if the leaves all have a surface area that is similar, it could make finding them a lot easier - you could find them by area.
Can you post a sample skp of an imported tree?
Maybe we can get you half-way there, if not all the way.
Thanks for responding jim!
I can't load up an onyx tree due to the user agreement, though the same effect would be buy grabbing any SU tree with component leaves and exploding down to base geometry.
I would imagine the script would either search for alike areas or simply alike geometry. The script would only need to locate one similar face and then select all connected and replace!
I would imagine the script wouldn't be so hard to do but could be a great time saver where ever a model contains numerous instances of the same geometry.
My 0.02 of your earth pence worth...
Area might be a good key, you might also want to group connected geometry, find its OBB (oriented bounding box) and then match on that. And of course then you'd have the necessary local transform "for free" too!
The biggest problem is that processing geometry in Ruby is spectacularly slow and if you're going to be using dense geometry you might be waiting a long time.. Oh but you do raytracing don't you, so you're used to that.
Adam
-
@adamb said:
@richard said:
@jim said:
The biggest challenge is identifying the geometry for a leaf. My first thought was that if the leaves all have a surface area that is similar, it could make finding them a lot easier - you could find them by area.
Can you post a sample skp of an imported tree?
Maybe we can get you half-way there, if not all the way.
Thanks for responding jim!
I can't load up an onyx tree due to the user agreement, though the same effect would be buy grabbing any SU tree with component leaves and exploding down to base geometry.
I would imagine the script would either search for alike areas or simply alike geometry. The script would only need to locate one similar face and then select all connected and replace!
I would imagine the script wouldn't be so hard to do but could be a great time saver where ever a model contains numerous instances of the same geometry.
My 0.02 of your earth pence worth...
Area might be a good key, you might also want to group connected geometry, find its OBB (oriented bounding box) and then match on that. And of course then you'd have the necessary local transform "for free" too!
The biggest problem is that processing geometry in Ruby is spectacularly slow and if you're going to be using dense geometry you might be waiting a long time.. Oh but you do raytracing don't you, so you're used to that.
Adam
thanks adam!
Yes mate using the likes of maxwell I'm used to waiting LOL!!!
I think though that the benefits of this idea given SU's lack of handling large hi poly models without taking advantage components and groups is worth the consideration of this time loss early rather than later!
When I bring an onyx tree into SU the leaves are generally in 2 or 3 groups and need repainting. just exploding these three groups for regrouping into one can take my machine an hour now! And then I have no ability at any stage to map images to the leaves without doing them one at a time, 10000 leaves NOT A CHANCE!
Advertisement