[Plugin] Random Painter (Updated March 9th, 09)

[Plugin] Random Painter (Updated March 9th, 09)

Postby Chris Fullmer » Sun Feb 08, 2009 1:09 am

Random Painter (Chris Fullmer Tools)
Pretty straightforward. This script works by using the selected geometry and painting it. The user has to first choose the colors to be used from a color palette. This needs something called WxSU Ruby to work. So please download and install it first. Once the colors are input, the script finds all the faces and then paints them randomly from the previously input colors.

The video shows how I use it, and it also shows how to use it with "Make Unique" and "Combine Textures" which are built into to SU version 7.


After the 2:10 mark, I just show how to use Make Unique and Combine Textures, its not really about the plugin at that point.

Also, known bugs: If you type in stuff other than RGB values, it might crash the whole script or else they will just get ignored and not paint anything on some faces. Also, I think I coded it wrong because the cancel button doesn't work - oops! I might have to go back and figure that out, because it should defintely work.

Hope that helps, and dont pay any attention to my inability to type and talk in the video :)

Chris

Download the required wxsu if you don't have it

OR there is now a non-wxsu version included below. It is a little slower to use, but it works pretty good.
0
Last edited by Chris Fullmer on Sat Mar 21, 2009 9:06 am, edited 4 times in total.
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Random Painter

Postby pilou » Sun Feb 08, 2009 1:28 am

Amazing :enlight:
Some connections possible with this script CheckerBoard Painting in developpment by Todd Burch?

Don't work with this?
Is that normal? (I had of course selected all facets ;)

Even another figure :o
How do you make the first drawing?

And only Alt +Ctrl + Del for stop ;)
0
Last edited by pilou on Sun Feb 08, 2009 1:53 am, edited 1 time in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Random Painter

Postby gaganraj » Sun Feb 08, 2009 1:45 am

that is really cool. its like making procedural textures in modo or lightwave!
0

gaganraj 
 

Re: [Plugin] Random Painter

Postby Chris Fullmer » Sun Feb 08, 2009 1:50 am

Pilou, I have a feeling it is painting the other side of the face. I think it only paints the front side of the face.

And to get out of the RGB input, just click ok with nothing entered in the boxes. If it applies color that you don't want, then undo it. I need to figure out better how to get the cancel to work right - sorry :(

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Random Painter

Postby pilou » Sun Feb 08, 2009 2:02 am

You absolutely right that work fine!!! :fro:
Just inverse faces and all works like a charm for any drawing surfaces!!! :enlight:
Todd is defeated :mrgreen: You are brutal with him :D
0
Last edited by pilou on Sun Feb 08, 2009 2:49 am, edited 1 time in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Random Painter

Postby pilou » Sun Feb 08, 2009 2:12 am

Man that is very fun! :thumb: :thumb: :thumb:
Using Zorro2 is perfect!!! :fro:

Now you must permit to choose between colors paletts!
Because it's very painful to enter by hand some colors!

Ruby technical state is ended, now artistic step begin :fro:

Phone Todd to stop his script! :lol:
0
Last edited by pilou on Sun Feb 08, 2009 2:50 am, edited 1 time in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Random Painter

Postby pilou » Sun Feb 08, 2009 2:27 am

Another thing!
That will be very useful too to apply the colors pallet without randomize! :enlight:
By Orgelf
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Random Painter

Postby Ecuadorian » Sun Feb 08, 2009 2:59 am

Wow, thank you, Chris!
In a minute I'll show you what I wanted this for...
0

Ecuadorian 
 

Re: [Plugin] Random Painter

Postby Chris Fullmer » Sun Feb 08, 2009 3:26 am

Pilou wrote:Todd is defeated! You are brutal with him :D


No, its not like that. Todd's script does a lot more thinking than mine. His works so that every other face is painted to create a checkerboard pattern. Mine will do no such thing. Mine just randomly paints the faces. Both have their uses.

I know of a ruby add-on that gives a color wheel thing. I'm going to try and see if I can figure out how to get it to work with this plugin so you can use a color wheel to pick the colors instead of typing them all in by hand. I make no promises on this one though,

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Random Painter

Postby pilou » Sun Feb 08, 2009 3:37 am

Mine just randomly paints the faces. Both have their uses.

Ok I understand you pick facets in any order! :oops: :o :roll: :lol:
It's a pity ;)

About colors
The must will be to use a pallet who yet exist so no need to pick on a wheel color or enter numbers!
like this for example

then I copy past in one move I have that
#334433 #3366aa #6699aa #aabbbb #778877
or that with any difficulties in any Notepad or other
#334433
#3366aa
#6699aa
#aabbbb
#778877
So If you have a board to put that inside that will be perfect!

If I can enter a simple list of color by copy past it be perfect!
0
Last edited by pilou on Thu Oct 08, 2009 11:55 pm, edited 1 time in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Greeble city is now possible thanks to your random painter!

Postby Ecuadorian » Sun Feb 08, 2009 5:29 am

Ok, this is what I did with Random Painter + Random Push Pull + Greeble. As I just need Random Painter as a placeholder for different materials, I just entered sucessive values: Green 10, Green 20, Green 30, etc., and in the second example Red 20, Red 40, Red 80. Then I replaced those colors with materials I had prepared, and which I am attaching here.

First, I made a 1Km x 1Km square, and divided it with SCF Toolbar's Greeble several times. Then I Protruded it 100m with offset 4-12m.
High_rises03.jpg


I copied the upper faces and deleted the rest. Then I divided those faces even more and again, protruded them 100m with offset 1-3m, again kept only the upper faces and procedded to "random paint" them with Green values from 10 through 110. Why Green? Because that's my favorite color.
High_rises07.jpg


I then proceeded to replace those colors with the 11 high-rise textures I had downloaded from cgtextures.com (I had resized them to 12 pixels height (EDIT: 120 pixels) to keep the file manageable). I just used the paint bucket + Shift. I am attaching that material library as a zip file so anyone can use it.
High_rises08.jpg


I then made three concentric groups of those faces. To make the groups, I changed to a Top view, rotated 45 degrees and used right-to-left marquee and Right click > select > all connected. For the outer ring, I used random push-pull 45/9m. I also re-pasted the faces from the first step and pushed them 20cm to act as sidewalks.
High_rises11.jpg


The middle ring was random pushed/pulled 90/18m, and after this graphic, the inner group was random PP 180/36m.
High_rises12.jpg


I then changed to Parallel projection > side view and carefully selected all the roof faces with a left-to-right marquee. After that, I "random painted" them with Red values 20, 40 and 80.
High_rises13.jpg


Finally, I replaced those red colors with roof textures. I then re-built the 1Km x 1Km square again to represent the streets. That's it! Greeble City made possible thanks to your "Random Painter"!
High_rises14_b.jpg


This exercise was inspired by a $4,000 program for "parametric" generation of cities I saw on the web. I just wanted to prove that you can "random generate" cities in SketchUp, too. Thank you a lot, Chris, for delivering the missing link to make this possible.
0
Last edited by Ecuadorian on Sun Feb 08, 2009 6:50 pm, edited 3 times in total.

Ecuadorian 
 

Re: [Plugin] Random Painter

Postby Ecuadorian » Sun Feb 08, 2009 5:38 am

Here are a few more views:

High_rises15.jpg

High_rises16.jpg

High_rises17.jpg

High_rises18.jpg


And here's the thread that inspired this exercise:
viewtopic.php?f=72&t=15785
0

Ecuadorian 
 

Re: [Plugin] Random Painter

Postby Ecuadorian » Sun Feb 08, 2009 5:42 am

Pilou wrote: Phone Todd to stop his script! :lol:


Both scripts are very different, each serves a different purpose. I am already thinking of a couple of creative uses for Todd's script, both related to Greeble... You have to see beyond mere colors and into the selection possibilities of these tools.

And Pilou, you don't need to worry about entering precise values when using "Random Painter". Just click on the Red box and input "1", hit Enter, then "2", hit Enter, then "3", until you have the number of colors/materials you want. And then replace those "placeholder colors" with Any Colour You Like, one by one, with the Bucket tool + Shift.

Almost forgot: Here's the SketchUp file of "Greeble City":
0

Ecuadorian 
 

Re: [Plugin] Random Painter

Postby MALAISE » Sun Feb 08, 2009 8:01 am

Awsome, the way you do it Chris :thumb: .

Ecuadorian, i like very much this city view ;thanks for the trick

Pilou, tu es un beta testeur de classe Alpha :D

MALAISE
0
La Connaissance n'a de valeur que partagée
User avatar
MALAISE 
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby Chris Fullmer » Sun Feb 08, 2009 8:42 am

Thanks everyone! And wow!, that is a great usage for the script Ecuadorian! Maybe I'll play around with seeing if there is a way to use a folder of jpgs as the random materials instead of random colors. THen you could put all the building materials into a folder and just choose the folder and off it goes! But that might be over my head, I don't know.

But what I wanted to say was that I updated the script!

NEW!

Now there's a color palette for you to choose your colors from. It also lets you enter RGB values if you'd like. It does not allow for hex numbers though Frenchy, so no copy and paste still. This version requires WxSU plugin. So please install it and then install my plugin and see how it goes, hope you like the improvements. Also, I just added a prompt asking if you want to paint the backside of faces too. If your version doesn't ask that, then redwonload my plugin. It looked like a few people downlaoded the version that did not have that implemented yet.

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby linea » Sun Feb 08, 2009 9:49 am

great script, thanks
0

linea 
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby pilou » Sun Feb 08, 2009 10:52 am

New York rebirth :enlight:

WxSU Ruby is 2 649 742 size ? :o :o :o (as 2,6 Gigas?)
Seems not reasonable loading :)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby thomthom » Sun Feb 08, 2009 11:38 am

As 2.6 Megas.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby kwistenbiebel » Sun Feb 08, 2009 11:50 am

Amazing stuff, Chris.
This plugin comes in handy for an architecture project I am working on.
Thank you very much ! :thumb:
0

kwistenbiebel 
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby pilou » Sun Feb 08, 2009 12:02 pm

As 2.6 Megas.

Many Thx! :enlight: Seems more reasonable :mrgreen:
I had asked that because loading was not working till yet for me :(
Edit : works :)
0
Last edited by pilou on Sun Feb 08, 2009 12:27 pm, edited 1 time in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: Greeble city is now possible thanks to your random painter!

Postby thomthom » Sun Feb 08, 2009 12:15 pm

Ecuadorian wrote:This exercise was inspired by a $4,000 program for "parametric" generation of cities I saw on the web. I just wanted to prove that you can "random generate" cities in SketchUp, too. Thank you a lot, Chris, for delivering the missing link to make this possible.


I saw that software as well. Played around with rubies to quickly generate some simple buildings.

With all these various plugins, it should be possible to make a City Generator script which automates the process you just did. What would be more interesting is if there was a script to generate streets in a non-rectangular pattern. Seeing how nearly every city is more organic laid out.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby pilou » Sun Feb 08, 2009 12:47 pm

Very more confortable for the color choice! :enlight:

About the greeble, there is now a message between each new generations: is that normal? :?:
0
Last edited by pilou on Sun Feb 08, 2009 1:58 pm, edited 1 time in total.
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby kwistenbiebel » Sun Feb 08, 2009 1:28 pm

This is how I am using the plugin.


0

kwistenbiebel 
 

Re: Greeble city is now possible thanks to your random painter!

Postby Chris Fullmer » Sun Feb 08, 2009 5:40 pm

thomthom wrote:With all these various plugins, it should be possible to make a City Generator script which automates the process you just did. What would be more interesting is if there was a script to generate streets in a non-rectangular pattern. Seeing how nearly every city is more organic laid out.


THat's precisely what my plan is Thom. My decision to get into scripting came immediately after a marathon weekend of modeling the entire city of San Jose (in California). I thought there needs to be a better way to make filler buildings. Thats why I started with the greeble script. I'm hoping to grow it into more of a building generator.

But I had not considered using the colors like this. Its really quite nice. I'm impressed with how everyone is using it! I wish I could get the custom colors to remember what they were set at. But that seems impossible at the moment.

@Frenchy - sorry aboutt he greeble popping up a number message everytime you greeble. That was part of my testing and I thought I clread it out before uploading. So I uploaded another version of it to get rid of that annoying pop up if you'd like. Thanks for your patience!

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: Greeble city is now possible thanks to your random painter!

Postby thomthom » Sun Feb 08, 2009 5:47 pm

Chris Fullmer wrote:THat's precisely what my plan is Thom. My decision to get into scripting came immediately after a marathon weekend of modeling the entire city of San Jose (in California). I thought there needs to be a better way to make filler buildings. Thats why I started with the greeble script. I'm hoping to grow it into more of a building generator.

I'm in particular interested in working out an algorithm to generate a streetmap. I'm thinking that a script would take a face and generate streets represented by single lines. Now it should be possible for the greeble script to split up the faces in between the streets and construct buildings. I hope to find some resources on the internet on creating procedural formulas, which a person without a math doctor degree can understand.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: Greeble city is now possible thanks to your random painter!

Postby Chris Fullmer » Sun Feb 08, 2009 6:05 pm

thomthom wrote: I hope to find some resources on the internet on creating procedural formulas, which a person without a math doctor degree can understand.


Thats the key, isn't it?! I'm surprised at how complex some things are to do.

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby tbd » Sun Feb 08, 2009 7:02 pm

0
SketchUp Ruby Consultant | Podium 1.x developer
http://plugins.ro
User avatar
tbd 
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby Ecuadorian » Sun Feb 08, 2009 7:36 pm

If someone has already worked on a "city generator" and makes it available for free, It wouldn't hurt to try and convince him to join the SketchUp Community and adapt those algorithms for SketchUp (either commercially or for free), share his source code, or provide an output in a 3D format SU can import. Check these efforts:

This guy wrote a city generator include file for POV Render. The zip download includes the city script (which you can peruse with any text editor), some pre-made buildings in .obj format, and some documentation in .txt format:
http://www.geocities.com/ccolefax/citygen.html

And here's a way more sophisticated free city generator, scripted for Softimage's XSI (Now part of Autodesk):
http://www.paoloemilioselva.it/citygenerator.html
0

Ecuadorian 
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby EarthMover » Tue Feb 10, 2009 5:51 am

My internet goes down for a week and so many great things happen on this site!

Thanks so much Chris. I've been using 3DS Max a lot this week and one of the things I was playing around with quite a bit is the "Material by Element" modifier. When a Multi/mixed material is applied to an object, the modifier will randomize the various sub materials among the different elements nested within the object. It also allows you to add a percentage of each sub material that the modifier will apply.

Max has material ID numbers which allow for the connection between materials and modifiers to be more fluid. I was wondering if there were a way via ruby to perhaps set the Random Painter script to call materials based on a naming function. Let's say I wanted to apply 5 random textures, or 5 variations of a single texture to group of faces. If those materials were named as Random_1, Random_2, etc, could the scripts be modified to called those textures and randomly apply them to the desired faces?
0
3D Artist at Clearstory 3D Imaging
Guide Tool at Winning With Sketchup
Content Creator at Skapeup
User avatar
EarthMover 
Premium Member
Premium Member
 

Re: [Plugin] Random Painter (Updated Feb 7, 09)

Postby Chris Fullmer » Tue Feb 10, 2009 7:12 pm

Hi Adam, just to clarify for my brain, you want essentially the same functionality but with image textures. Is that the idea? Or is it more in depth than just that?

BTW, I don't know how to work with textures, so it will take me a little while to figure it out. But it should be possible.

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: Exabot [Bot] and 15 guests

Visit our sponsors: