Strange bug in MakeHuman GUI class...help!


(Manuel) #1

Hi!

This is the new version (not totally usable: pre-pre-alpha…) of the class to write
quickly a GUI in Blender script. Ken75 and me are writing this to use in BlenderMakeHuman,
but we think this can be usefull for all Blender users. With the alpha release we want
add a short pdf documentation.

http://members.xoom.virgilio.it/bastioni/free3d/my_gui16a.zip

Ok, now the strange bug. We use a several class; if you take a look in the text list in Blender,
you can see this:

BaseWindowClass.py
Sliderwin.py
Timewin.py
Messagewin.py
Picture.py
test2

“test2” is a example of client code.

The “Sliderwin.py” is the class to draw a window with a custom number of sliders.
In this class, the main function is createSlider. The argument of this function is the
number of the slider:

	def createSliders(self, numSlider = 2):

		for i in range(numSlider):
			
			# Creating slider number i #
			self.slider.append( Create(0.00) )

			# Creating label for slider i #
			self.label.append("S%d: " % i)
	
			# Setting 'start', 'main' and 'end' default values #
			self.startValue.append(-1)		
			self.value.append(0.0)
			self.endValue.append(1)

			# Setting the default tooltip #
			self.toolTip.append("Tip%d" % i)
	etc...
	etc...

You have a notice that for each slider this function add a new label,new start value, end value etc…

Ok.

In the sample of client code, named “test2”, we have two different instances of sliderwin.
A sliderwin with 4 sliders, and a sliderwin with 8 sliders:

THE BUGS:

  1. If you change the sliders value in the 8sliderwin, when you move the mouse on the slider of the
    4sliderwin, this 4 slider button move itself !! (Try to change the value in 3 or more sliders, to see the bug certainly)

  2. If you look the label in the 8sliderwin, the names is s0,s1,s2,s3,s0,s1,s2,s3, and not the
    s0,s1,s2,s3,s4,s5,s6,s7, that we want to see by “for i in range(numSlider):” !!

  3. The 8sliderwin is a new istance of a Sliderwin class. In the sample we don’t assign a border or a background
    color, because we want default value for this variables. But the new istance have the same value of 4sliderwin !!!

Ok…me and Ken75 can’t solve this problem…
Please help…

Thanks,

          Manuel

PS::
in the image.py I’ve used a code that I found on internet. I don’t know the autor,
but I remember this code posted on the old Blender forum. If anyone know his name,
please tell me: I want thank…


(theeth) #2

I think the bug is in the class hierarchies, though I really don’t know where the actual error might be. Truth is, I never really touched multiclassing, because it usually creates a mess of dependancies (IMHO).

Martin