i want to use a menu in a panel
where i can select a color from some color palette
like RLA or Military WWII colors ect.
problem is that the color name does not show the color itself
is there a way to have a menu giving the name and a color swab to see the color and be able to select it
thanks
happy bl
If you are referring to an actual menu type I think you would have to make custom icons to display color swatches and since they wouldn’t be easily updated would become problematic to maintain. However you mentioned you want this in a panel so I would recommend looking at the python template for ui_list_simple.py which can show a material name and color.
will test that ui_list_simple.py
be back later on
thanks
happy bl
i can see the color in a list !
not really the best way
some list are very long and might be a problem to limit the space taken by the super long list
have to find another way
may be adding a color swab somehow and show the color
is there an example on how to add a color swab in a panel ?
and after that will have to try to port that into 2.9
wow hope it is not too complicated
thanks
happy bl
let me show you my 2 menus
which are already very long
happy bl
If you already have the color swabs as image files you could modify the ui_previews_dynamic_enum.py template which creates icon previews for image files in a directory. Honestly need more info about how you generate the list to begin with and what you intend to do with the selected item from the list.
Keep in mind Blender should be releasing the asset manager in 2.93
i’m stuck on 2.9 till i get a new PC sometimes later on this year
COVID-19 is making life difficult around
i got many menu for different color palette
and the first menu select which color palette
then the second menu shows the color palette
after that i simply add mat to the selected object
addon right now is like 12000 lines - empty lines
it is a big script LOL
but it allows to add 100’s of specific colors for WWII models
but also other Colors palette
thanks
happy bl
I’ve added an example addon to github that may help to show you how to handle this ( Nezumi72/IO-CSV-colors: Blender 2.9x Example import color data (rgb, hex, hsv) from csv file; create icon swatches; perform operations based on selected color data. (github.com). It is functional but only intended as an example. If your code is as large as you say it sounds like you have data embedded in your script that would be better served outside and loaded when needed.
will take a look at your example
data is like color for RAL tables
so only color name color ,and HEX value
and for other color palette too
but i also made some nodes tree set up for adding new mat slot on object with specific node set up
and that is taking a lot of space in script too
mind you still looking for some script node tree set up for 2.9
looks like there was many changes done to nodes tree set up
and now we have cycles or EEVEE and there is the Geometry nodes set up WOW that is a lot of trees and branches !
thanks
happy bl
For setting up material nodes there are several video tutorials available like https://www.youtube.com/watch?v=eo7UjKFiagk however I would suggest instead of using index numbers for inputs and outputs of the node connections use index names. The reason I would suggest using the name is due to additional inputs or outputs being added through different versions. If you only use an index number connections may be made incorrectly between say blender 2.80 and blender 2.90.
will look at video
i already searched the web and found only one very simple example for adding a PBR node
but there was not link or other nodes
i install your first file for color
and i can see new Test panel added in UI - n panel
i was able to import RAL
then what do you do ?
i mean does this creates a new mat or add it to a selected object ?
note: i don’t really need the export part
only need to add a mat slot on a selected object
thanks
happy bl