Is instancing possible?
-
Hi all,
First my congratulations with the forum. It's really nice. Thanks for setting the whole thing up...And here is my question:
Can instancing be done in Sketchup (by a Ruby script)?
Instancing would be veruy usefull for making a lot of trees people etc.. in Sketchup.I can imagine a following workflow:
- Make a dummy component for a tree (a simple cube for instance).
- Place (a lot) of 'instances' of that simple component on the terrain mesh.
- Open up an 'instancing' ruby window: link the cube component to some hi-poly tree component.
- In that same Ruby window you have a check box that toggles on/off the appearance of the component.
Off= you see the cubes , ON= you see the trees.
Is this possible to perform?
Such a tool would be great to have so we can finally export 'big' scenes to our 3d party rendering engines.
Regards,
Kwistenbiebel -
Hi,
Rick Wilson developed a script that may help you, almost exactly what you want: applyto.rb.
Here is what it does:
Context-click on a component or set of components.
Select "Component Definitions>Get Definition" to get a definition to apply.
Select "Component Definitions>Apply Definition" to apply a selected definition to selected components.You can download it at my site (see signature). Go to "Metric Plugins" page, then click on "Editing" section. Scripts (right-most column) are sorted alphabetically, so it is the 5th
hope this helps,
-
Look for my Matrix Proximity script(s).
Matrix lets you place 2D/3D arrays of components at set XYZ spacings and with randomized spacing, rotation, and scaling/handing etc as desired. It then lets you 'drop' these onto any surface below the matrix.
If you have a family of components called tree01+.skp, tree02~.skp and tree01-.skp for components that are near(+), mid-distance(~) and far-away(-) - with appropriate degrees of complexity in their modelling, then you could use the '-' version for all modelling - whether it's by matrix OR manual placement...
Then when you are done and you have set up your views you can use Proximity. This lets you set the range of near-mid and mid-far from the camera and swaps any nearby components with the more detailed ones as specified - For example only trees within 10m of the viewer might have leaves etc and 10m-30m might be simple 3D but beyond that the '-' version could be a 2D lollipop with face-me set...
Take your images... swap all to '-' trees again then change view re-run Proximity etc etc...
This minimises the file size and speed of regens etc...
-
Thanks Didier and TIG for pointing out both rubys.
The first one seems very suitable for what I have in mind.
I will try that one out.Just a question more: is there also a ruby that let's you select all the instances of a same component?
Any of the scripters thought about combining all the rubies that involve component behaviour/editing/selecting/instancing in to 1 ruby window?
...Thanks again guys, it feels as if this community has the @last spirit again.
-
Hi K, (too long for a name )
@unknownuser said:
Just a question more: is there also a ruby that let's you select all the instances of a same component?
As a suggestion you could try my quick selection command.
It can select what you want in the model, it is based on filters, Autocad-like.
Download it at my site, "Selection-Layers" page, or here:
http://www.crai.archi.fr/RubyLibraryDepot/Ruby/EM/quick_selection.zip
Hope this helps, -
There are so many rubies that I don't know and that are useful.
Thanks...and my appreciation to all ruby writers. -
-
Hi Coen,
The rubies are categorized in some way at my site (8 different sections)
I would like to have your opinion about these categories and about what should I do to enhance the listing. Any hints ? -
@didier bur said:
Hi K, (too long for a name )
@unknownuser said:
Just a question more: is there also a ruby that let's you select all the instances of a same component?
As a suggestion you could try my quick selection command.
It can select what you want in the model, it is based on filters, Autocad-like.
Download it at my site, "Selection-Layers" page, or here:
http://www.crai.archi.fr/RubyLibraryDepot/Ruby/EM/quick_selection.zip
Hope this helps,Hi Didier,
I installed the ruby but I do not understand how it works properly.
I have a hi polycount tree component that I want to place as multiple instances.
As a dummy I created also a simple cube as component.
Now, how can I substitute all those cubes to the trees?Thanks
-
Pick one of the 'tree-to_go' instances.
Use 'Entity Info' to get the Compo'Definition name [if you don't know it already].
In the Comp'Browser 'In Model' tab hover over that compo's icon.
Right-click to get the context-menu.
Choose 'Select Instances'.
All of the 'tree-to_go' instances are now selected [highlighted].
Now still in the Compo'Browser find and hover over the compo 'tree-to_swap' icon.
Right-click to get the context-menu.
Choose 'Replace Selected'.
All of the 'tree-to_go' compos have become 'tree-to_swap'.Done.
This Ruby-less method lets you select and work on / swap compos etc quiet easily...
-
TIG,
Thanks for all this support.
I will try that method right away.Regards,
kwistenbiebel
Advertisement