• Welcome to the Community Forums at HiveWire 3D! Please note that our store and forum are on two separate servers so you will require a separate login for each. The store will ask you for your Real Name (WILL NOT BE displayed to the public) and the forum will ask you for a User Name (WILL BE displayed to the public). You may use the same email address and password for both.
  • The 14th Annual Songbird Remix Open Rendering Season Contest is now open! See the contest thread for details.

Instantiation Via (Poser) Geometry Swapping ?

Ken1171

Wise
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

Wise
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

Wise
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

Wise
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

Adventurous
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

3dcheapskate

Adventurous
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

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

3dcheapskate

Adventurous
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

Wise
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

Adventurous
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