Where is setBreastSize (in human.py) called *from*?

If your topic doesn't fit anywhere else, put it here.

Moderator: joepal

Where is setBreastSize (in human.py) called *from*?

Postby chris.f.rice » Wed Feb 16, 2022 7:03 pm

Hi there. I'm an experienced software developer but new to python, and this is a potentially dumb question.

I'm running makehuman from source, trying to learn how it works. I know that setBreastSize is called when I move various sliders (because log.debug statements I place in there are executed), but I can't tell where it is called *from*. That text "setBreastSize" does not appear anywhere else in the source code.

How is it possible that it is called without appearing in source code? Is a pointer to this function mapped into the UI, or something? If so where does this occur, and how does it work?

Thanks!
chris.f.rice
 
Posts: 4
Joined: Wed Feb 16, 2022 2:48 pm

Re: Where is setBreastSize (in human.py) called *from*?

Postby RobBaer » Fri Feb 18, 2022 11:00 pm

I haven't looked specifically, but I think this happens through the QT event loop doing updates when a slide changes.
User avatar
RobBaer
 
Posts: 1208
Joined: Sat Jul 13, 2013 3:30 pm
Location: Kirksville, MO USA

Re: Where is setBreastSize (in human.py) called *from*?

Postby chris.f.rice » Sun Feb 20, 2022 12:46 am

That makes sense, thank you. But an odd thing is that when I move one slider, *multiple* calls to setXYZ (breast, width, etc) are triggered. I'm sure this is some sort of macro mapping, but I can't understand this mapping without figuring out how/where these are called. (And this would be very helpful for me to understand.)

If it is in a Qt event loop, do you have any guesses about how I can understand (a particular source or config file, for example) how this loop is programmed/configured to make these calls?

Thanks again!
chris.f.rice
 
Posts: 4
Joined: Wed Feb 16, 2022 2:48 pm

Re: Where is setBreastSize (in human.py) called *from*?

Postby joepal » Sun Mar 06, 2022 2:36 pm

The idea is that you should be able to move the slider back and forth and see updates in real time without releasing the slider. So that multiple events are broadcasted is expected.

The event management in MakeHuman is old, arcane and rather complex.

Basically the root functionality is here: https://github.com/makehumancommunity/m ... vents3d.py

As you can see in https://github.com/makehumancommunity/m ... icommon.py, events3d is then inherited into other objects.

The actual change event is emitted from line 132 here https://github.com/makehumancommunity/m ... odifier.py
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am


Return to General discussions about makehuman

Who is online

Users browsing this forum: No registered users and 1 guest