If you want to color some of your models.

Show off your FreeCAD projects here!
freedman
Posts: 1796
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

If you want to color some of your models.

Postby freedman » Sun Nov 08, 2020 2:03 am

I made a macro that will random color or set to default grey all objects. Thought this might help make some of those grey models light up. To use, run the macro and push a button, Close it when your done. This will over-ride any colors you have set previous.

Hope this helps....
Attachments
multi_color.PNG
multi_color.PNG (25.81 KiB) Viewed 1013 times
Vision_color.FCMacro
(3.01 KiB) Downloaded 30 times
User avatar
Roy_043
Posts: 2569
Joined: Thu Dec 27, 2018 12:28 pm

Re: If you want to color some of your models.

Postby Roy_043 » Sun Nov 08, 2020 10:13 am

Are you aware of this command?:
Std_RandomColor
freedman
Posts: 1796
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: If you want to color some of your models.

Postby freedman » Sun Nov 08, 2020 7:51 pm

Are you aware of this command?:
Std_RandomColor
I didn't know you could do a selected area. Certainly not as easy to use as the macro and I wanted the user to be able to restore a default.

I would like FreeCAD v0.20 to get some additional standard properties like:
visibility_tmp
transparency_tmp
shapeColor_tmp
By switching between the tmp and standard properties a showman could highlight specific portions of a model and then switch back to their previous working colors. Or randomized all the colors in tmp and then switch back to standard.

Once I saw this link I just had to try something, this thing is so cool looking, it would look exceptional in color.
https://forum.freecadweb.org/viewtopic. ... er#p419859
User avatar
watsug
Posts: 99
Joined: Sat Sep 26, 2020 10:51 pm

Re: If you want to color some of your models.

Postby watsug » Sun Nov 08, 2020 10:27 pm

Nice!

How do you decide the colors? The code seem to be a constant added to r, g and b. Also, why are the these variables called am, bm, cm?

When you use this macro or stc_RandomColor, the colors are sometimes not so desirable. Something I thought about before was being able to define a "color swatch" or some other way to only use colors that work well together (or colors that match your stylesheet or OS theming).
freedman
Posts: 1796
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: If you want to color some of your models.

Postby freedman » Mon Nov 09, 2020 12:00 am

Also, why are the these variables called am, bm, cm?
If you want to clean up the macro and repost, that's fine, I didn't have alot of time so I did the best I could. Sometimes I post these things and noone pays attention, other times folks read the code.

The am,bm,cm, I was having some trouble so I added a m to abc, it ended up staying like that...

I haven't been able to get the addon manager to work (with me), so when I do I could put this in there.
un1corn
Posts: 161
Joined: Sat Dec 26, 2015 2:06 pm

Re: If you want to color some of your models.

Postby un1corn » Fri Feb 12, 2021 12:15 pm

Another way to colour parts is to right click the part in the tree of parts, select set colour, select the part to change colour, choose the colour you want and click ok.
The only drawback I found is that each face of the part has to be selected, which is also good for applying different colours to different face of the same part.