Replace groups with component
-
Hi all,
I've got got a tree with MANY leaves, all of which are groups and are identical(for now).
Basically, to improve performance i want to just use one component definition.
So, i'm wondering if i make a component out of one, if i can replace all the groups and still retain their rotation etc.
Any help would be great... otherwise i may need to finally splurge on that brain upgrade iv'e been saving for
Cheers
C
-
Work on a copy of the SKP.
Save it.
Make your new replacement leaf-component with its origin/axes matching the current leaf-group.
If the leaf-groups are not all similarly 'axis-ed' then you've got problems...Select all of the leaf-groups to be 'fixed'.
Run this one liner in the Ruby ConsoleSketchup.active_model.selection.each{|e|e.to_component if e.is_a?(Sketchup;;Group)}
Now you have lots of leaf-group-components.
Reselect the converted instances.
Open the 'Component Browser' and hover over the replacement leaf-component, right-click > 'replace selected' - all of the various leaf-group-components will now become the new leaf-component.
Use the 'Purge unused' function on the pop-out of the 'Component Browser' to delete the now unused leaf-group-components and tidy up...If it screws up close without saving !
-
TT1s selection toys can also select all "group copies" (i.e. unaltered copies of the same group definition) and convert them into instances of the same component definition.
http://forums.sketchucation.com/viewtopic.php?t=14975(Certainly not to lessen TIG's precious advice above)
-
What kind of performance improvement are you expecting?
Making each leaf a component doesn't make the model more responsive - it still need to draw and process the same amount of polygons. It might make the file size smaller - though it might also make it larger (I think there is a thread where someone did some tests and found that each group and component has a overhead - so if the geometry it contain is only a handful of elements it's not effective in terms of file size.) -
But... from a convenience viewpoint having all of the tree's leaves as instances of the same component is useful because you can swap them out with other another leave component en mass...
-
Also, we are dealing with a theoretical question here. Certainly no-one would think (seriously) about populating a forest with xfrog trees in SU (although we may dream about this).
Then another useful thing about making them components is that once you export it to some usable format, the components can act like instances in Twilight, Kerky, Thea etc. and that speeds up rendering.
-
Hi Gaieus,TIG,ThomThom
Thanks so much for your replies/help.
All the leaf textures are applied the same on all leaves, so i'm going to try both techniques, which will no doubt help my understanding.
I wasn't sure how much performance i would gain from using components, but thought it would help But yes, i would be handy to have that control.
I work for Landscape Architect so there is no escaping trees and plants! I'm just trying to strike a balance and make things a bit more manageable.
I am also trying to build a case for purchasing VRay - fingers crossed
I know i could just Google, but does any know any good 'ruby for beginner' resources?
Thanks again, i'll let you know how i get on!
Corey
-
Hi Folks, I have a similar issue...would love some advice! I had a search on the Net but nothing came up.
My typical 3d trees have 200k edges, 50k faces, 15k components.
I noticed that modelling every leaf from a series of components (triangles) will result in 50k components, but this actually slows the model down (redraw rate).
Can anyone tell me if there's an ideal number of components per model, or as a factor of edges/polys? Which is most important in SketchUp models 5mil+ edges?
(Hardware: Quadro 4000, 6-core Xeon 3.2, SSD)Cheers!
Sam. -
Thomthom's Selection Toys (http://forums.sketchucation.com/viewtopic.php?t=14975) is indispensable for this. It's a one-click operation and one of my essential plugins.
When you have a renderer which renders instanced components, using 3d trees becomes feasible, as long as you use some form of proxy object in SU to make performance acceptable.
There are many 3d tree applications, and to the best of my knowledge, none of them have instanced leaf components when imported into SU. Sometimes you can use plugins to regularise these things. Thom also has a plugin called Component Comparison (http://forums.sketchucation.com/viewtopic.php?t=30143), which might also help with components which aren't quite identical.
Advertisement