[Plugin] Blackout

[Plugin] Blackout

Postby thomthom » Fri Jan 16, 2009 12:04 pm

This plugin was made on request from Free Agent which wanted a script that turned all materials black so he could then make one material white and render out a material mask for post processing. Hence the name.

I later added another function that picked the material of a selected and turned that white and the rest black, just to make it a little bit more quicker to set it up.



NOTE! Run this script on a backup file!!!
This script removes all textures, and opacity and modifies the colour. While the operation is undoable it's all to easy to accidentally save the file. (I press Ctrl+S regularly as a habit.)

Plugin is operated from the Plugin menu. "Blackout" and "Mask Material"

Tested against SU6 & 7

---

Update 1.2.0:
Free Agent had a got idea: use the current material instead of the selected object's material. Added this new function.

Download

0
Last edited by thomthom on Fri Nov 29, 2013 12:30 am, edited 4 times in total.
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] Blackout (1.1.1)

Postby Stinkie » Fri Jan 16, 2009 12:17 pm

Thanks alot!
0
User avatar
Stinkie 
 

Re: [Plugin] Blackout (1.1.1)

Postby CadFather » Fri Jan 16, 2009 12:48 pm

ThomThom you're rolling now!

Thanks! :D
0
User avatar
CadFather 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Blackout (1.1.1)

Postby free agent » Fri Jan 16, 2009 1:19 pm

:thumb: :geek:
0
User avatar
free agent 
 

Re: [Plugin] Blackout (1.1.1)

Postby plot-paris » Fri Jan 16, 2009 1:36 pm

sounds cool and useful :thumb:

immediately the 'Greyscale' by Jim Foltz springs to my mind.
the script turns all colours to greyscale. then you can one or several textures to be changed back to colour to make them stand out more clearly. somehow Jim managed to preserve all the colour information, the script lets you toggle between 'Greyscale-' and 'Colour-mode'.
that would be the perfect thing to take your script to the next step - make the changes undoable...
0
User avatar
plot-paris 
 

Re: [Plugin] Blackout (1.2.0)

Postby thomthom » Fri Jan 16, 2009 1:45 pm

The original colour could be stored in an attribute dictionary. But I'm not sure about textures. I didn't find a way to turn them off. Only remove them. Will have a look at Jim's script and see if he handles textures. I've not spent much time on this. Just quickly whipped it together while working on some other stuff.
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] Blackout (1.2.0)

Postby kwistenbiebel » Fri Jan 16, 2009 1:55 pm

Cool script thomthom! :thumb:
Very useful. Thank you.
0

kwistenbiebel 
 

Re: [Plugin] Blackout (1.2.0)

Postby bianhai » Fri Jan 16, 2009 6:12 pm

:thumb:
Thank you thomthom.
0

bianhai 
Banned
 

Re: [Plugin] Blackout (1.2.0)

Postby Gaieus » Fri Jan 16, 2009 7:44 pm

Tom,

In SU you can undo an operation after saving, too. Does it not work in this case?
0
User avatar
Gaieus 
 

Re: [Plugin] Blackout (1.2.0)

Postby thomthom » Fri Jan 16, 2009 7:48 pm

I suppose so. But I make the warning just in case as there isn't any built in restore in the function. Also, with V-Ray for SketchUp I've experienced that it can some times interfere with the undo operations of scripts. Especially if it manipulates materials.
It's a better safe than sorry warning. ;)
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] Blackout (1.2.0)

Postby sepo » Sat Jan 17, 2009 2:05 pm

This is useful. Thanks.
0

sepo 
 

Re: [Plugin] Blackout (1.2.0)

Postby JClements » Sun Jan 18, 2009 11:13 pm

ThomThom:

I think this might have been discussed a year or two ago.

I make masks for postprocessing by turning all my layer colors to black and turn on Color By Layer in the Layer Manager. This eliminates messing with the material colors directly. I hardly ever organize my layers via a color scheme so this method is relatively fast to do and doesn't screw up the model. Also, SU shadows are exported with their greyscale value which can be interpreted in post processing as semi-transparent.


I often create a style for Color by Layer in my model and assign it Scene named "MASK" which only remembers style parameters. I can then use this scene to on toggle Color by Layer for any of the other scenes.

My workflow would be to click on any Camera view or Scene and select the "MASK" Scene, and export the current view as your mask for post processing.

Now IF Ruby can remember and store a model's existing Layer Colors and later restore them, then a script to temporarily change the model's layer colors to black, turn on Color by Layer, queue the File > Export > 2D Graphic dialog and then restore the layer colors after printing, might be pretty quick and handy.
0
John | Illustrator | Beaverton, Oregon

JClements 
Premium Member
Premium Member
 

Re: [Plugin] Blackout (1.2.0)

Postby thomthom » Mon Jan 19, 2009 12:22 pm

Interesting.
I made this script very very quickly. I might revise it and implement some more stuff suggested. Appears that there was more use for this than I thought. And there's some good ideas here.
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] Blackout (1.2.0)

Postby MALAISE » Sat Jan 24, 2009 8:58 am

THanks Thomthom

Back to the forum after a while and discovering new rubies :D :D

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

Re: [Plugin] Blackout (1.2.0)

Postby me3mar » Sun Feb 01, 2009 1:58 pm

can you please show some pics on how to use, and what for ?
that would be great
thanks in advance
0

me3mar 
 

Re: [Plugin] Blackout (1.2.0)

Postby sepo » Fri Jun 26, 2009 4:57 pm

Would it be possible to include transparency of .png . Give you an example. If you for instance have a .png tree in front of the material than tree should go black instead of rectangle. It would make life much easieer if possible.
Thanks
1

sepo 
 

Re: [Plugin] Blackout (1.2.0)

Postby thomthom » Fri Jun 26, 2009 5:34 pm

Nope. Can't read transparency info. If I had access to the V-Ray maps I could have replaced the texture with the alpha texture - but I don't have access to that either.
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] Blackout (1.2.0)

Postby sepo » Fri Jun 26, 2009 11:02 pm

Thanks for the reply.
0

sepo 
 

Re: [Plugin] Blackout

Postby xiombarg » Wed Mar 19, 2014 5:36 am

This is actually another really good plugin for character and product design and a standard feature of high end modelling programs. Animation modelling programs implement this feature to help the designer get a better idea of a characters posture and demeanor which subtly reflects their personality. Product designers also use it for similar purposes.

Probably is a good idea to do a quick save before using it though, just in case.
1
User avatar
xiombarg 
 

Re: [Plugin] Blackout

Postby onzki » Fri Aug 04, 2023 7:08 am

Hi I know it's an old thread. Is there a way to customize the color, instead of black maybe something else, like red or any RBG code? Thanks!
0

[/hr]Dell Alienware Area-51. SKU 2021 Pro. AutoCAD 2023. Landscape design firm

onzki 
 

Re: [Plugin] Blackout

Postby Didier Bur » Fri Aug 04, 2023 10:23 am

Hi onzki,

Go to your 'Plugins' folder and open 'blackout.rb' in a pure text editor (Notepad++ for instance).

Search for lines like this one:
Code: Select all
material.color = 'Black'

Replace 'Black' with the color you want, like 'red', 'green', 'blue' and so on.

Lines to be modified are: 42, 69,91, if i'm not mistaken.

The names of available colors can be found on this page:
https://ruby.sketchup.com/Sketchup/Color.html

To customize the color with RGB values will be a little longer to explain ;)
Save the file blackout.rb, quit SketchUp and restart.

Regards,
1
Didier Bur
User avatar
Didier Bur 
 

Re: [Plugin] Blackout

Postby Didier Bur » Sat Aug 05, 2023 1:34 pm

Hi, me again,

Here is an enhanced version with which you can select your color in a list.
Menu can still be found in the 'Extensions' menu but I've put the 3 options in a sub-menu to spare your menu space ;-)
Hope Thomthom won't mind if I modified his script.

blackout_dialog.jpg

blackout_menu.jpg


Regards,
3
Didier Bur
User avatar
Didier Bur 
 

Re: [Plugin] Blackout

Postby onzki » Fri Aug 25, 2023 8:05 am

Didier Bur wrote:Hi, me again,

Here is an enhanced version with which you can select your color in a list.

Regards,


Amazing! Big Thanks! :D :thumb:
0

[/hr]Dell Alienware Area-51. SKU 2021 Pro. AutoCAD 2023. Landscape design firm

onzki 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Plugins

Who is online

Users browsing this forum: andricasc, Google Bot, rzhond and 13 guests