What version of Python will Panda3d 1.9 use on a Mac?

Panda3d 1.8.1 uses Python 2.5 on Mac. This can cause problems, since it uses Python 2.7 on Windows, so some developers writing Python code for Panda on Windows use Python features not available in 2.5, causing their code to fail on a Mac for no good reason.

Is there any chance this will be updated in Panda 1.9 so it also uses Python 2.7 on Mac?

I point out that Apple has long since started shipping Python 2.7 with Mac OS X; I don’t know the details for all versions, but Mac OS X 10.7.5 (which is already pretty old) came with Python 2.7.1.

(As far as I know, the only reason Panda has not been using the same Python on Mac and Windows all along was the desire to use a Python shipped by Apple rather than bundling its own. I would question that desire too, but that’s a different issue.)

My thought was to start offering builds requiring Lion, which ships with Python 2.7, so that wouldn’t be any problem at all.
However, there are some users still on Snow Leopard, which only ships with 2.6. So at this point, I am tempted to ship both Python 2.6 Snow Leopard and Python 2.7 Lion builds on the download page for 1.9.

Experimental builds I made a while ago (both 64-bit, I think):
rdb.name/Panda3D-1.9.0-osx10.6-py2.6.dmg
rdb.name/Panda3D-1.9.0-osx10.7-py2.7.dmg

That would be great.

(If it’s not too much trouble to make, you might consider shipping a Python 2.7 Snow Leopard build instead or as well as Python 2.6 Snow Leopard. I would not use it myself, but if I was still using Snow Leopard I’d find it more useful, due to better python compatibility, in spite of its larger size, due to its including its own Python.)

I tried this on a Mac OS X 10.9.4 machine, and it worked in my initial test, except for a minor window appearance/position bug on startup. Would you like details of that? (I will probably try it more and/or on other machines, and I’m happy to submit more bug reports if that would be useful – just tell me the best place.)

Yes, I would. If it’s a minor thing, you should feel free to post it here, though I may defer you to the bug tracker if it turns out to be something non-trivial or something I won’t have time for in the short run.

Ok, let’s hope it’s minor enough. This was in Mac OS X 10.9.4, on a machine that never before had Panda installed, and which didn’t even have a /Developer directory before I installed Panda, let alone any dev tools. (It presumably doesn’t have Cg either, and Panda never complained about that.) I ran the installer from [problem with latest builds) .

When you start the program, the window ought to be in the screen center (at least it is on my usual mac, OS X 10.7.5 using Panda 1.8.1), but instead:

  • it’s left justified on screen (leaving no space for my dock),

  • it’s at or almost at the top of the screen (except it did leave room for my menubar),

  • and it has a bug in positioning the content area of the window vs. the title bar of the window – the content area obscures the bottom half or so of the title bar. (The red/yellow/green buttons on the left of the window title bar are half-obscured, but still work if you move the mouse high enough over their visible parts – at least they all highlight, and the red one works to quit the program.)

Resizing the window (by dragging the bottom right corner) works, and makes this bug of obscured title bar go away.

I tried another test program and didn’t notice this bug, so it might depend on exactly what transforms are set up, or on exactly how the window size is initialized. (Or maybe I wasn’t looking carefully enough to see the bug.) (That program has a bug in programmatically moving the mouse, but until I debug that further I don’t want to blame the new Panda version specifically.)

I have a screenshot if you need it, but it’s not handy right now to post.

I didn’t yet try the new Panda on my usual Mac.

I would indeed like to see a screenshot of it.

I would also like you to try running this and see what it outputs:

from direct.directbase import DirectStart
base.graphicsEngine.openWindows()
print(base.win.getProperties())

The default setting of “win-origin” in /Developer/Panda3D/etc/Config.prc is set to “-2 -2”, which indicates to center the window on screen. Does the issue still happen if you specify a positive number, or is it just the window centering logic that is somehow not working?

Here is the screenshot:

Watching more carefully, I see that maria’s script does start out in the center of the screen, then in a fraction of a second it expands to the size/position I described. It also looks like the window exactly hits the bottom edge of the screen (a laptop screen, which is a retina display) – maybe this causes the obscured-title bug.

The code you wanted me to try outputs this:

DirectStart: Starting the game.
Known pipe types:
CocoaGraphicsPipe
(all display modules loaded.)
origin=(240, 100) size=(800, 600) title=“Panda” !undecorated !fixed_size !fullscreen foreground !minimized open !cursor_hidden normal absolute

If I modify maria’s script so that right after

self.base.win.requestProperties(wp)

it does

print(base.win.getProperties())

, that print statement’s output is unchanged, which I suppose means I’d have to add a delay of some kind before printing, to allow the requested properties to take effect, which I’m too lazy to look up how to do right now.

As for window-origin in Config.prc, if I change two lines like this

win-origin 0 0
win-size 1024 768

to imitate maria’s script, then running the three lines you suggested, I get:

DirectStart: Starting the game.
Known pipe types:
CocoaGraphicsPipe
(all display modules loaded.)
origin=(0, 44) size=(1024, 768) title=“Panda” !undecorated !fixed_size !fullscreen foreground !minimized open !cursor_hidden normal absolute

and during the fraction of a second that I saw the window, it didn’t have an obscured title bar.

(240, 100) would match the origin for a centered 800x600 window on a 1280x800 screen, which indicates that Panda is at least trying, but that somehow Cocoa isn’t doing the right thing.
When you manually set the origin to (240, 100), does it center correctly, or does it also demonstrate the issue?

Is there any multi-screen set-up going on - just to rule out the case that Panda may be setting the coordinates relative to the wrong screen?

Maybe I’ll have to upgrade my own Mac to Yosemite soon to try and see if I can reproduce it.

I just looked at Maria’s script and noticed that it explicitly contains instructions to set the origin to (0, 0) and the size to (1024, 768). I guess I may have misunderstood your problem. The window being placed on the top left side and enlarged is exactly what you’d expect to see with that configuration.
The only issue, as I understand, is the fact that the content area is half placed over the title bar. I would guess that this is because the window is moved down to compensate for the title bar, but the content area position isn’t being updated properly. Probably an event we’re not handling properly.

it explicitly contains instructions to set the origin to (0, 0) and the size to (1024, 768).

Sorry, I should have mentioned that explicitly. I had not noticed those window-positioning instructions when I first reported the bug (so I included the window position in my list of bugs), but I noticed it later, which is why I tried setting those variables in Config.prc to imitate those instructions.

I agree that the window position is not a bug, only the obscured title bar. (And since the next user-initiated resize corrects it, it’s pretty minor.)

(BTW this is not in Yosemite but in the prior Mac OS X, Mavericks.)