• Welcome to the Community Forums at HiveWire 3D! Please note that the user name you choose for our forum will be displayed to the public. Our store was closed as January 4, 2021. You can find HiveWire 3D and Lisa's Botanicals products, as well as many of our Contributing Artists, at Renderosity. This thread lists where many are now selling their products. Renderosity is generously putting products which were purchased at HiveWire 3D and are now sold at their store into customer accounts by gifting them. This is not an overnight process so please be patient, if you have already emailed them about this. If you have NOT emailed them, please see the 2nd post in this thread for instructions on what you need to do

Instantiation Via (Poser) Geometry Swapping ?

Ken1171

Esteemed
Contributing Artist
How does it work to change the colors on a WX button? It has a background and a foreground color, but setting those do not affect a very thick border all around the button. I have created a dark theme for my GUI, and these thick white borders are ruining it. I have searched the documentation and I couldn't find out why this happens.

Buttons.jpg


Any hints? Is this normal?
 

Karina

Member
I can't remember exactly where I read this, but I think some elements like buttons have only limited graphic options because wxPython derives them directly from the functions of the OS.
OTOH, I find these look quite nice as they are. For my ever deteriorating eyesight it improves visibility and readability for me. :)

K
 

Ken1171

Esteemed
Contributing Artist
@Karina Well, if it can't be helped, I will leave it be. Thanks for the feedback. I am spoiled by pyQT5, where we can skin everything and even create themes for the GUI.
 

Karina

Member
I just checked:

Run my KMIE script I sent you.
Directly after start, the background of the large [ PLEASE SELECT A MORPH ] button is the same colour as the [ CLOSE ] button below.
Because I didn't (yet) specify any bgColours at all, both buttons seem to default to system colours. EDIT: (Confirmed: the widget's bgColour and the button colour *are* my system defaults)

Now select a morph:
The box becomes green and whammo! There's the same border as in your screen capture!


K
 

Ken1171

Esteemed
Contributing Artist
The box becomes green and whammo! There's the same border as in your screen capture!

Yeah, we only see the border when we skin the buttons. They "forgot" to add the border colors on the parameters. Either that, or we are missing something...
 

Ken1171

Esteemed
Contributing Artist
Hehe he definitely looks perplexed! Nice grass - I have used it in my scattering and it works great! ^^

Indeed it has been just 19 days since I started writing the scatter script, and it would had taken less time if I haven't created the first interface with TKinter. I had to scratch that, learn wxPython, and create a whole new interface. And then the command to duplicate objects was not in the Poser manual, and aligning objects to a surface took long to get right. There were no lack of delays and obstacles, but if there is a will, there is a way! :D
 

3dcheapskate

Brilliant
I admire your tenacity - usually at the first sign of an obstacle I'll get distracted, go and do something else, and often totally forget what I was trying to do in the first place. :roflmao:

(But in this particular case I got distracted without any obstacle appearing - I was just gobsmacked by how good those blades of grass look ! Even without the eye-candy of F202 Dollie in her pink bikini ! :D)
 
How does it work to change the colors on a WX button? It has a background and a foreground color, but setting those do not affect a very thick border all around the button. I have created a dark theme for my GUI, and these thick white borders are ruining it. I have searched the documentation and I couldn't find out why this happens.

View attachment 58405

Any hints? Is this normal?

You need to subclass wx.lib.buttons.GenButton to have the control you want.
First, import wx.lib.buttons

Then do something like this:

class EZButton(wx.lib.buttons.GenButton):

def __init__(self, parent, label = wx.EmptyString, btn_name = wx.EmptyString, wxid=wx.ID_ANY, style=0):

# Initialise the base class
wx.lib.buttons.GenButton.__init__(self, parent, wxid, label=label, name=btn_name, style=style)

# Configure appearance
self.SetBezelWidth(1)

# Add bindings
self.Bind(wx.EVT_ENTER_WINDOW, self.EnterWindow)
self.Bind(wx.EVT_LEAVE_WINDOW, self.LeaveWindow)

def EnterWindow(self, event):
bg_colour = self.GetBackgroundColour()
R, G, B = bg_colour
if max(R,G,B) > 235: return
new_bg_colour = wx.Colour(bg_colour.Red() + 20, bg_colour.Green() + 20, bg_colour.Blue() + 20)
self.SetBackgroundColour(new_bg_colour)
self.Refresh()

def LeaveWindow(self, event):
bg_colour = self.GetBackgroundColour()
R, G, B = bg_colour
if max(R,G,B) > 235: return
new_bg_colour = wx.Colour(bg_colour.Red() - 20, bg_colour.Green() - 20, bg_colour.Blue() - 20)
self.SetBackgroundColour(new_bg_colour)
self.Refresh()
 

Attachments

  • Clipboard01.jpg
    Clipboard01.jpg
    28.9 KB · Views: 150

3dcheapskate

Brilliant
Getting back to the grass (which is actually rather off-topic), I realized that, with real grass, it's usually the upward-pointing, sky-aspiring, sunlight-seeking, upwardly mobile blades of grass that are nice and green, while the flattened, squished, downtrodden lower ones are usually more yellowy-brown. My first thought was tomodify the texture image,so that the bottom of each blade is yellowy-brown while the top is green. But that won't work for completely downtrodden blades. So I thought, why not chuck a P-node into the mix ? I then used the Y coordinate of this to drive the hue of an HSV node into which was plugged my simple texture map.
405 faces for the grass in the renders below.
Render 1.jpg
Render 2.jpg
Pnode.jpg
 

Ken1171

Esteemed
Contributing Artist
I have the impression you could have done the same using a color ramp and a blender node.
 

3dcheapskate

Brilliant
Yes indeed, there's many ways to blend the colour from brownish at the bottom to greenish at the top. :)

(But something appears to have gone wrong with the UV mapping - the bottom of each blade of grass is (should be?) mapped to bottom right of the texture map, and the top to the top left,so the thick yellow spine runs top to bottom on each blade)
 

Ken1171

Esteemed
Contributing Artist
Ah, that would be easy to see in the template. In 3DSMAX, there are 2 test maps: one traditional checkers, and one with numbers and letters so we can see is something is inverted or upside-down.
 

3dcheapskate

Brilliant
Darn it ! Checked the blend file and it turns out that I used the wrong, non-UV-mapped, single quad grass blade as the basis for every grass blade in that last patch.

Re test maps - I have my own versions of those but very rarely use them. Which is probably why I end up making stupid mistakes like this ! :oops: :roflmao:
 
Top