[Plugin] Extrapolate Colors v1.0

[Plugin] Extrapolate Colors v1.0

Postby Chris Fullmer » Thu Aug 27, 2009 7:46 am

All right, here's a new script called Extrapolate Colors.

Description This script finds materials used in a set of selected faces, and then randomly applies those same materials to all selected faces that have no material applied.
Usage Run the script from Plugins > Chris Fullmer Tools > Extrapolate Colors.

First select a series of faces, at least one needs to have a meterial applied to it. Then run the script. The script will find all materials in the selection (only materials applied to faces though). And it will randomly apply those materials to all faces in the selection set, leaving faces untouched that are already painted.

Note that the script works on raw geomtery. It does not work on groups or components (but it does work on raw geometry inside a group or component if you are editing a group/component).



I am hosting this script on smustard.com. It is a free download:
http://www.smustard.com/script/ExtrapolateColors

Hope its useful,

Chris

PS I've Got quite a few color scripts. I might package them all togther, with some added featires intoa Web dialog based color script and charge a little for it. We'll see though.
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] Extrapolate Colors v1.0

Postby pilou » Thu Aug 27, 2009 8:35 am

Very tricky pattern randomizer :thumb:
A start of a new lists of crazzy plugins? ;)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] Extrapolate Colors v1.0

Postby david_h » Thu Aug 27, 2009 3:27 pm

thanks Chris. . .Another winner.
0
If I make it look easy. . .then it probably is.
User avatar
david_h 
Top SketchUcator
 

Re: [Plugin] Extrapolate Colors v1.0

Postby trillium » Thu Aug 27, 2009 4:48 pm

:sketchstatic: :sketchstatic: :sketchstatic:
thank you sooooooo much chris for all your wonderful rubies!!! i'm working on a pool with glass tile blend and this is just perfect!!! :enlight:
0

trillium 
 

Re: [Plugin] Extrapolate Colors v1.0

Postby boofredlay » Thu Aug 27, 2009 9:41 pm

Nice one Chris.
0
User avatar
boofredlay 
Global Moderator
 

Re: [Plugin] Extrapolate Colors v1.0

Postby Chris Fullmer » Thu Aug 27, 2009 10:28 pm

Thanks Dave, Trillium, and Eric.

I already see places to tweak it and make it better.

For example, currently if you have a face that is cut in 2, but the dividing line is hidden/smoothed, it still counts as 2 faces. I would prefer if the tool determined what a "face" was the same way that the selection tool does. It adds all faces together that have smoothed edges.....if that makes any sense.

Anyhow, I know Fredo already provided me with a snippet that will help fix this. But it will take a little while to get it worked into my script. But I might do it today, because I could really use the fix for a project I'm working on :)

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] Extrapolate Colors v1.0

Postby EarthMover » Thu Aug 27, 2009 11:23 pm

Thanks Chris this will be very helpful and a lot easier than the random painter method.
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] Extrapolate Colors v1.0

Postby Aerilius » Fri Aug 28, 2009 12:20 am

This is great! It reminds me on an atlas: There exist also (complicated?) mathematical algorithms that prevent neighbouring faces from having the same color.
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Extrapolate Colors v1.0

Postby Chris Fullmer » Fri Aug 28, 2009 12:54 am

@Aerilius - I had not considered it, but that would be an interesting idea. I'm not sure what the algorithm would be, but there is probably something online to describe it.

@Adam - I was waiting for you to chime in. I think this script is useful for a lot of things that us landscape architects do. I hope you find it useful.

The plan is to put it into a webdialog with a few more feautes, better control over the amount that materials should be applied, overwrite existing colored faces, redoing it (in case it comes out a little wrong the first time so you can quickly re-apply the textures), etc.

Hopefully in time I'll get the mode in-depth version made.

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] Extrapolate Colors v1.0

Postby Jim » Fri Aug 28, 2009 1:31 am

I guess I am more curious about if the pavers shown in the video were hand-made, or made using a plugin?
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] Extrapolate Colors v1.0

Postby Chris Fullmer » Fri Aug 28, 2009 2:10 am

I cut them with my lazer eye vision.

or I might have drawn them all by hand using the freehand tool, and lattice-izer to do the offsets for me. Then Shapebender to put a nice light bend to my path.

I am still thinking about ways to do procedural hatches in SU - for things like brick and stonweork and all sorts of hatches.

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] Extrapolate Colors v1.0

Postby EarthMover » Fri Aug 28, 2009 3:17 am

Chris,

As soon as I saw the plugin in use, I thought of procedural hatches as well and how nice it would work with them. I have a repeating flagstone pattern that I made and which I use to make a hatch manually for certain projects. I ran it through lattice-izer and then ran extrapolate colors on it and it work like a charm. I'm stoked about the results. Thanks again.
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] Extrapolate Colors v1.0

Postby Chris Fullmer » Fri Aug 28, 2009 3:22 am

Awesome, that looks really good Adam! I hope this little script saves you time in the future. Its already saved me a bunch!

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] Extrapolate Colors v1.0

Postby EarthMover » Sat Aug 29, 2009 3:34 pm

Chris...this is a stretch, but could the script be tweaked to also work with groups and subgroups? If you were to have a group of bricks consisting of each brick as it's own subgroup and you wanted to random texture each brick, would it be possible to extrapolate the colors from 3 or 4 groups and randomly distribute them to the other groups, doing so in a way that all geometry within the subgroup be textured with the same material, but randomly painted from one group to another?

Like I said, I know it's a stretch, but it would help me a lot.
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] Extrapolate Colors v1.0

Postby Chris Fullmer » Sat Aug 29, 2009 4:21 pm

Yeah, that is something I would like to add. My question is hsould the script only sample materials applied to the outside of groups? Or should it search all the geometry insde of groups and use all materials found?

Should it then apply materials to the geometry inside groups, or should it just apply materials to the outside of groups?

I was thinking that it would only sample materials applied to the outside of groups and components, and then only apply them to the outside of groups/components. This method would make it easier to apply a single material to all faces of a single group. But it would be impossible to apply different materials to each face in a single group.

I could theoretically add toggles and switched so that the user could specify each of these possible variables. It would have to be done in a web dialog, but that is my current project. So maybe I could try to work all these options into a single web dialog version of this script (which I'm working ont at the moment).

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] Extrapolate Colors v1.0

Postby Aerilius » Sat Aug 29, 2009 10:31 pm

I found something about painting no two adjacent regions with the same color. I twas used in the past for maps when printing techniques did not allow a large color diversity.
http://en.wikipedia.org/wiki/Four_color_theorem

I think the script would need to check each face's neighbouring faces.
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Extrapolate Colors v1.0

Postby kwistenbiebel » Sun Aug 30, 2009 7:40 am

Wow, great work there chris!
Indeed much easier to use than the randomize color plugin, which already was great by the way.

This is the first step to having Procedural texturing in Sketchup.
Fantastic!

Thanks!
0

kwistenbiebel 
 

Re: [Plugin] Extrapolate Colors v1.0

Postby EarthMover » Sun Aug 30, 2009 2:39 pm

Chris Fullmer wrote:Yeah, that is something I would like to add. My question is hsould the script only sample materials applied to the outside of groups? Or should it search all the geometry insde of groups and use all materials found?

Should it then apply materials to the geometry inside groups, or should it just apply materials to the outside of groups?




I'd imagine applying to the outside would be much easier to code. That would work for me. Vray for Sketchup hates materials applied to the outside of groups, but I usually run Matt666's Remove CG Materials script to transfer those materials to the inside of the group before using VfSU anyway.

The web dialog sounds promising. In Max, there is a material by element modifier that I use to do this task. It gives you a dialog with two options.....either Random Distribution, or By Frequency. The By Frequency option lists the materials according to their material ID # and lets you adjust a percentage number for each material to determine how frequently it shows up in the assigned mesh. You can also set the material ID # of each element (group) within a mesh and assure that that element will only get one material, while the others get random. In the example of bricks, the mortar joint would be set to an ID # that get's 100% frequency, while the bricks may get an ID set to 4 different textures distributed at 25% of each.
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] Extrapolate Colors v1.0

Postby Jim » Tue Sep 01, 2009 4:25 pm

Code: Select all
require 'Sketchup.rb'


Come on, Chris! :lol:
0
Hi

Jim 
Global Moderator
 

Re: [Plugin] Extrapolate Colors v1.0

Postby Chris Fullmer » Tue Sep 01, 2009 4:51 pm

Jim wrote:
Code: Select all
require 'Sketchup.rb'


Come on, Chris! :lol:


I'll try a little Jedi mind trick like ThomThom...

You saw nothing wrong Jim. Redownload the script, you'll see there is no sloppy bad-coder typo there. There is nothing to see.

Chris

-fixed and reuploaded, thanks Jim! That fixed a menu bug I was experiencing too.... :? Man I am bad at this programming stuff, and I think I'm getting worse!
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] Extrapolate Colors v1.0

Postby dominion » Mon Jan 17, 2011 11:03 pm

Chris this plugin rocks however not being able to use it on components is causing me some serious difficulty if I explode all my component blocks to the outside edge in the render then the textures are no longer tiled correctly for some reason, any idea of a work around?
0

dominion 
 

Re: [Plugin] Extrapolate Colors v1.0

Postby Chris Fullmer » Tue Jan 18, 2011 12:00 am

Hmm, could you upload a model that is not working right? I'm sure I could get it to work for you.
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] Extrapolate Colors v1.0

Postby dominion » Tue Jan 18, 2011 10:36 am

Hi mate sorry it wont let me upload the model says its to big (5mb)

can i email it to you?
0

dominion 
 

Re: [Plugin] Extrapolate Colors v1.0

Postby simon le bon » Tue Jan 18, 2011 4:27 pm

Hi Chris,
Excellent tool!
:thumb: :thumb: :thumb: :enlight:

simon

PS: Hum! I hadn't once again noticed the date: "by Chris Fullmer on Thu Aug 27, 2009 8:46 am"
This is a tool I hadn't discovered before, I'm sorry. ;)
0
Last edited by simon le bon on Tue Jan 18, 2011 8:21 pm, edited 1 time in total.
User avatar
simon le bon 
 

Re: [Plugin] Extrapolate Colors v1.0

Postby dominion » Tue Jan 18, 2011 8:13 pm

Chris i have upped the model here http://www.colordrives.co.uk/Problem.skp thanks in advance :)
0

dominion 
 

Re: [Plugin] Extrapolate Colors v1.0

Postby jarynzlesa » Sat Jan 22, 2011 1:14 pm

Thanks super plugin. So simple so useful. :thumb: :thumb: :thumb:
0
User avatar
jarynzlesa 
 

Re: [Plugin] Extrapolate Colors v1.0

Postby skeletor » Wed Apr 03, 2013 8:56 am

Sooo close to have this work for me, but not having the ability to apply the random colors to components/groups is disheartening. Basically I have a building model with >24000 of the same components making up a facade element on a building I'm designing (student) I tried a workaround with a vray material utilizing a material made of up the bars of colors that make up the facade, but the low resolution, and the large size of the material made that a no go. Is there anything out there that could possibly take that color palate, and randomly apply (weighted or not) the colors to all like components? I really don't want to go through and apply each color separately as I can see that taking at the very least 4 hours to get it right. Anyway, thank you for the plugins you have made, I use several of yours along with a collection a others I've found here it's a wonderful resource!
0

skeletor 
 

Re: [Plugin] Extrapolate Colors v1.0

Postby iordirequena » Mon Apr 29, 2013 4:09 pm

YEAAH freakin' thank you bro! really
0

iordirequena 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: No registered users and 19 guests

Visit our sponsors: