[plugin]Random replacement of components

[plugin]Random replacement of components

Postby sdmitch » Tue Jun 21, 2011 7:16 pm

In response to viewtopic.php?f=323&t=37434 and others, I have written a plugin to accomplish this given two sets of components, a source set and a target set. These sets are identified by giving all the members of the set the same component name. Components also have a definition name which is what is entered when the component is created. The component name is displayed and can be assigned in the Entity Info panel. The appearence of a component is determined by the definition assigned to it by the definition name. If a sub-set of target components are pre-selected, then only those will be randomly changed.
0
Last edited by sdmitch on Wed Jun 22, 2011 7:17 pm, edited 2 times in total.
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: [plugin]Random replacement of components

Postby Pilou » Tue Jun 21, 2011 9:51 pm

A little tut ;)
No limite of number of any components source or target! :thumb:
You can name all your source components by hand but it's painfull when you have numerous!
So a little trick ;)
Just select Components source and copy this in the ruby console
Sketchup.active_model.selection.each{|c| c.name='Source'}
Your source components are now named "Source"
You can make the same for Target Component ;)
Just select Components source and copy this in the ruby console
Sketchup.active_model.selection.each{|c| c.name='Target'}

Edit : In fact for the rename Source and Target you can make the just with the Entity Info Box! :mrgreen:

rollend1.jpg

You can now use the random plug ;) (click for zoom)
rollend2.jpg




Of course it's infinite possibilities :roll:
trop rigolo.jpg


You can fill the space with no periodic infinite volumes :mrgreen:
Rollem2.jpg

you can play with this speedy one :D

Edit 31 May 2012
A new variant without random is integrated!
No Random.jpg
0
Last edited by Pilou on Thu May 31, 2012 11:50 am, edited 18 times in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby Bertier » Wed Jun 22, 2011 8:45 am

is it possible to use this script to create custom set of trees ?
0

Bertier 
 

Re: [plugin]Random replacement of components

Postby Pilou » Wed Jun 22, 2011 11:40 am

Like a building construction game yes :enlight:
just careful that all connections between parts is good managed
But seems it's a painful work to divide a tree in small parts
then create some variations for all these tree's parts ;)

But if you want remplace just all one tree by another tree no problem
you will have different forest at each launch :fro:
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby harnstein » Wed Jun 22, 2011 12:27 pm

Man, that's great! Thanks to sdmitch!

Thanks to Pilou for this tut- even if i didn't really get it..yet. ;)

I'll give it a try asap.

How are the components replaced? By replacing it a the origin of axis within each component?

Is it possible to add random scale and orientation as well (like for scattering trees)?

Looks nice already!
0
still sketchin'

harnstein 
 

Re: [plugin]Random replacement of components

Postby Pilou » Wed Jun 22, 2011 12:41 pm

How are the components replaced? By replacing it a the origin of axis within each component?

I believe Yes

Is it possible to add random scale and orientation as well (like for scattering trees)?

I believe you can use some existing plugs for this at the end of the process ;)

Like Random select by TIG
and then make some Scale or Rotation / Move
+ in the same time Scale and Rotate mutiple who has randomly feature inside by Chris Fullmer :thumb: :thumb: :thumb:

Or with only the plug make a familly of trees with different Sizes and Rotations ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby srx » Wed Jun 22, 2011 4:26 pm

Thank you Sam :thumb: ...good plugin. Maybe this cod of tig for renaming the components could be integrated in your plugin,
so not to waste time on renaming. :)
0
User avatar
srx 
 

Re: [plugin]Random replacement of components

Postby sdmitch » Wed Jun 22, 2011 5:50 pm

First, there is no reason the change the component.definition.name only the component.name which is the only thing that the plugin checks for. If you select those components that you want to use as the Source set then, from the ruby console, "Sketchup.active_model.selection.each{|c| c.name='Source'}" will properly identify them as the Source set. Substitute 'Target' for 'Source' to identify the selected Target set.
0
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: [plugin]Random replacement of components

Postby Pilou » Wed Jun 22, 2011 5:58 pm

I will change again my tut ;)
PS You can make the same for Target's Components ;)
"Sketchup.active_model.selection.each{|c| c.name='Target'}"
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby sdmitch » Wed Jun 22, 2011 8:24 pm

Pilou, Thanks again for providing the tutorial. It looks perfect!!!
0
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: [plugin]Random replacement of components

Postby Pilou » Wed Jun 22, 2011 11:26 pm

In fact that is some redundant with the use of the Dialog box Info for rename a group of components! :oops: :D
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby Pilou » Mon Jun 27, 2011 1:32 am

Little teaser :enlight:
The 24 position Plug always by Sdmitch will be released in a few time! :fro:
A very pleasant plug! :thumb:
twenty4position.jpg
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby Edson » Mon Jun 27, 2011 12:38 pm

sdmitch wrote:In response to viewtopic.php?f=323&t=37434 and others, I have written a plugin to accomplish this given two sets of components, a source set and a target set. These sets are identified by giving all the members of the set the same component name. Components also have a definition name which is what is entered when the component is created. The component name is displayed and can be assigned in the Entity Info panel. The appearence of a component is determined by the definition assigned to it by the definition name. If a sub-set of target components are pre-selected, then only those will be randomly changed.

it would be great if the plugin's author could explain how to use it or, better still, post a tutorial showing it.

sorry, pilou, but yours is not that clear to me.
0
edson mahfuz, architect
http://www.mahfuz.arq.br

Anyone can get you more for more, but it takes genius to get you more for less.
User avatar
Edson 
Global Moderator
 

Re: [plugin]Random replacement of components

Postby Pilou » Mon Jun 27, 2011 12:51 pm

:) @Edson ("Definition Name" and "Name" are two distinc thing in a component)
select some components with different "Definition Name" in any position
Give the "Name" Source to these selection with the Info Dialog box

Draw another one component: Draw copy past it anywhere you want in any position
Select all these copies
Give the "Name" Target to the all selection copies with the Info Dialog box

launch the plugin Random Replacement :)
I can't be more clear :)

(the 24 positions is another plugin not yet released ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby Edson » Mon Jun 27, 2011 1:34 pm

Pilou wrote::) @Edson ("Definition Name" and "Name" are two distinc thing in a component)
select some components with different "Definition Name" in any position
Give the "Name" Source to these selection with the Info Dialog box

Draw another one component: Draw copy past it anywhere you want in any position
Select all these copies
Give the "Name" Target to the all selection copies with the Info Dialog box

launch the plugin Random Replacement :)
I can't be more clear :)

(the 24 positions is another plugin not yet released ;)

thanks, pilou. you are right: in writing, the explanation is very clear.

I have been asking for a similar plugin for a long time but no one seemed willing to create one. for me it will be very useful to randomize vegetation and windows (closed, open, half this, half that, etc).

a comment though: one does not necessarily have to name the source components source and the target ones target for the plugin to work. first I named them as you suggested and then I named them 1 and 2. the plugin worked in both situations. so, as long as there is a named source group and a named target group it works fine.
0
edson mahfuz, architect
http://www.mahfuz.arq.br

Anyone can get you more for more, but it takes genius to get you more for less.
User avatar
Edson 
Global Moderator
 

Re: [plugin]Random replacement of components

Postby Pilou » Mon Jun 27, 2011 1:36 pm

@Edson :)

No, Source and Target are not nescessary names ;)
It's just these given by default in the dialog box ;)
you can put any names you want :) (of course these that you have yet renamed your components in the Info Box ;)
But carreful it's sensitive cases !!!
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby Pilou » Wed Jul 27, 2011 11:22 pm

And here the 24 positions plug of Sdmitch ;)
With his autorisation! :fro:
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby AcesHigh » Fri Aug 12, 2011 3:52 pm

there are many uses for this plugin.

for example... think of 3D tiles on a roof. Each tile is a component. But the roof gets so artificial, with all the tiles exactly the same color, no stains, etc. With this plugin, you would be able to, for example, create some 10 different roof tiles, each of them a slight different color variation, some stains, etc. And randomly replace the original components along the entire roof.

another possibility: a building with a glass façade. Real such buildings will have curtains/blinds behind the windows. Make the the building with window components. The random replace them with OTHER window components, each window component with blinds in different positions (no blinds, blinds half way pulled, pulled down completely)


there are so many uses!!!
0

AcesHigh 
 

Re: [plugin]Random replacement of components

Postby rachmatrf » Tue Feb 21, 2012 9:28 am

Thhank you Sdmitch :berserk:
0

rachmatrf 
 

Re: [plugin]Random replacement of components

Postby Pilou » Thu May 31, 2012 10:39 am

Sdmitch has made a new variant with no Random integrated! :enlight:
(see second post for more precsion of use ;)

No Random.jpg
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby solo » Wed Feb 13, 2013 5:47 pm

This is not working for me, Pilou can I send you a sample model by pm and you show how to do it?
0
My site

Light travels faster than sound. This is why some people appear bright until you hear them speak.
User avatar
solo 
Global Moderator
 

Re: [plugin]Random replacement of components

Postby Pilou » Wed Feb 13, 2013 5:52 pm

Of course yes you can! :enlight:
with a small file (sufficient for the concept) and a save as V7!!! ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby solo » Wed Feb 13, 2013 5:58 pm

http://dl.dropbox.com/u/1129899/test%20tree.skp

Strange how the size of file increases 50% when saving as SU7 from SU 8.
0
My site

Light travels faster than sound. This is why some people appear bright until you hear them speak.
User avatar
solo 
Global Moderator
 

Re: [plugin]Random replacement of components

Postby Pilou » Wed Feb 13, 2013 6:02 pm

Sorry it's always V8 when its arriving at home !!! ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Pilou 
Top SketchUcator
 

Re: [plugin]Random replacement of components

Postby solo » Wed Feb 13, 2013 6:06 pm

0
My site

Light travels faster than sound. This is why some people appear bright until you hear them speak.
User avatar
solo 
Global Moderator
 

Re: [plugin]Random replacement of components

Postby JBJDesigns » Tue Apr 16, 2013 11:45 pm

This is an awesome plugin... thank you both very much!!! Jo :D
0
...you send them to school, you give them books, and they eat the pages...
User avatar
JBJDesigns 
Premium Member
Premium Member
 

Re: [plugin]Random replacement of components

Postby tetrochuan » Sat Apr 27, 2013 3:10 pm

might it be possible that the plugin would work with grouped and nested components?! that would be übercool!!
1

tetrochuan 
 

Re: [plugin]Random replacement of components

Postby coty82 » Wed Oct 15, 2014 7:00 am

This plugin is indeed great with so much potential. Do you think it could be possible to
make it able to replace child components that are inside mother componennts?
You could do so many patterns just by replacing components inside components.
0

coty82 
 

Re: [plugin]Random replacement of components

Postby sdmitch » Wed Oct 15, 2014 9:41 pm

coty82

Please check Personal Messages.
0
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: [plugin]Random replacement of components

Postby coty82 » Thu Oct 16, 2014 2:27 am

Hello sdmitch
Thanks for the fast reply! I have installed it but unfortunatelly when i try to use it it just freezes Sketchup no matter if i choose to include child components or not. Is it working for you?
0

coty82 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: Atex, bluecd, elisdaiana, skudan, srx and 7 guests

Visit our sponsors: