|
|
|
Return to Code Snippets
by ynjh_jo » Thu Nov 05, 2009 11:40 pm
deleted
Last edited by ynjh_jo on Sat Nov 21, 2009 5:25 am, edited 2 times in total.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by rdb » Fri Nov 06, 2009 8:02 am
Er, you must have misunderstood my blog post. The 'pandac' package is still there, and works exactly as it did. Only when you import Panda classes from the 'panda3d' package, they will not have the extension functions.
When I press Pause, I'm getting these problems:
- Code: Select all
Traceback (most recent call last): File "IDE.py", line 1203, in IDE_safeRun taskMgr._origRun() File "/usr/share/panda3d/direct/task/Task.py", line 482, in run self.step() File "/usr/share/panda3d/direct/task/Task.py", line 440, in step self.mgr.poll() File "/usr/share/panda3d/direct/showbase/EventManager.py", line 61, in eventLoopTask self.doEvents() File "/usr/share/panda3d/direct/showbase/EventManager.py", line 55, in doEvents processFunc(self.eventQueue.dequeueEvent()) File "/usr/share/panda3d/direct/showbase/EventManager.py", line 124, in processEvent messenger.send(eventName) File "/usr/share/panda3d/direct/showbase/Messenger.py", line 325, in send self.__dispatch(acceptorDict, event, sentArgs, foundWatch) File "/usr/share/panda3d/direct/showbase/Messenger.py", line 410, in __dispatch method (*(extraArgs + sentArgs)) File "IDE.py", line 1390, in IDE_toggleSceneActive IDE_pauseScene() File "IDE.py", line 1450, in IDE_pauseScene shootScene() File "IDE.py", line 1410, in shootScene renderFrame() File "IDE.py", line 1157, in renderFrame base.taskMgr.step() File "/usr/share/panda3d/direct/task/Task.py", line 440, in step self.mgr.poll() AssertionError: You may not recursively invoke the TaskManager from within a task at line 1226 of panda/src/event/asyncTaskChain.cxx pause Traceback (most recent call last): File "IDE.py", line 11389, in <module> IDErun() File "IDE.py", line 1215, in IDE_safeRun IDE_alertUserNcontinue() File "IDE.py", line 7699, in IDE_alertUserNcontinue IDE_safeRun() File "IDE.py", line 1215, in IDE_safeRun IDE_alertUserNcontinue() File "IDE.py", line 7696, in IDE_alertUserNcontinue IDE_processException( traceback.format_exc() ) File "IDE.py", line 6339, in IDE_processException splitTaskErrMsg=LOG.taskError.split() AttributeError : 'NoneType' object has no attribute 'split'
Also, I'm getting this error for the sample programs that use task.time: - Code: Select all
File "/home/pro-rsoft/Projects/panda3d-borked/samples/Ball-in-Maze/Tut-Ball-in-Maze.py", line 254, in rollTask dt = task.time - task.last AttributeError : 'libpanda.PythonTask' object has no attribute 'time' :task(error): Exception occurred in PythonTask rollTask
Weird, because when I run it outside of the IDE, it runs fine. (Also, in the background, I can see it fine. Twice, though.)
I prefer e-mail over PM
-
rdb
-
- Posts: 8547
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by rdb » Fri Nov 06, 2009 8:13 am
About the quotes and double-quotes not working, it appears to be a Panda bug. I'm investigating.
I prefer e-mail over PM
-
rdb
-
- Posts: 8547
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by ynjh_jo » Fri Nov 06, 2009 6:11 pm
- Code: Select all
File "IDE.py", line 1410, in shootScene renderFrame() File "IDE.py", line 1157, in renderFrame base.taskMgr.step()
I think that step() call is yours, I don't use taskMgr's anymore.
See, rdb wrote:Replacing the "renderFrame" function in IDE.py with something that calls base.taskMgr.step a hundred times works in some cases, but not everywhere.
rdb wrote:You might want to add a hook somewhere that your IDE stuff is only created once the window has been opened, or something like that.
I've made progress on it, by splitting IDE.py into 2 modules. The core module is imported after the first window-event. rdb wrote:when python files are specified on the command-line, instead of showing the welcome window, the IDE should open all python files directly as tabs.
Maybe not directly, since you still have to choose one of them to be the main file, so it should open the "Open Files" window with those files fed to it. It should support wildcards too. Is it good enough for you ? rdb wrote:Also, I'm getting this error for the sample programs that use task.time
I've seen that too in Asteroid, but that's only if it's the first main file. Otherwise, it's fine. rdb wrote:Also, in the background, I can see it fine. Twice, though.
Of course it's TWICE if you don't block World class instantiation. Read more about it in my 1st post.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by rdb » Sat Nov 07, 2009 2:12 am
ynjh_jo wrote:Maybe not directly, since you still have to choose one of them to be the main file, so it should open the "Open Files" window with those files fed to it. It should support wildcards too. Is it good enough for you ?
Possible, of you could make the first file that's passed the main file. Or when an -m option is passed on the command-line, the file behind it would be the main file.
Wildcards are automatically expanded by the shell before being passed to the program, AFAIK. Otherwise a glob.glob() would fix it.
I prefer e-mail over PM
-
rdb
-
- Posts: 8547
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by ynjh_jo » Sat Nov 07, 2009 3:15 am
Alright then, without -m, it'll open "Open Files" window, or use the first file, depends on a config.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ynjh_jo » Sun Nov 08, 2009 6:56 am
[_v0.3.6_] [X] fixed completer by differentiating dictionaries and instances
[X] fixed lots of bugs if there is no open file
[X] key down output is commented out
[X] added -fPIC option to g++ in TextDrawer compile script
[X] the IDE core code is executed after the first "window-event" event
[X] files passed to IDE_STARTER will be opened directly without showing the welcome screen. The first python file will be the main file.
[X] if the IDE is FULLY CREATED and running, all files passed to IDE_STARTER or using welcome screen will be opened by the already running instance of the IDE.
I dropped -m since getopt wants options in front, so the main file would be the first one anyway.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by cyberdarklore » Tue Nov 10, 2009 6:44 am
Your IDE brings me great inspiration as too what can be done in Panda3d & Python  , I'm new to both and trying to get my footings..... going to download and use it on my rig, complication is good as long as it is documented.
=->To any one who can answer this is there any reliable way to convert an egg back into a format importable by Blender while retaining and not loosing anything in the conversion? Using (.flc)OpenFlight Format seems to work for the model and UV at least.
=->And by the way while reading down this thread i found a reference to ubuntu  , I have seen this on other threads also, this coming from a person that has only been exposed to windows(PC) and has seen a mac in passing(just looked at one, some one was trying to impress me  , now I'm a little sad....), is ubuntu an operating system and if it is to what platform?
-

cyberdarklore
-
- Posts: 13
- Joined: Sat Nov 07, 2009 7:29 am
by ynjh_jo » Tue Nov 10, 2009 8:55 am
Ubuntu belongs to the Linux side of the world.
ubuntu.com
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ThomasEgi » Tue Nov 10, 2009 8:56 am
@ cyberdarklore: i didnt know panda can export flc files??
offtopic but since information was requested:
about ubuntu: it's linux-based operating system. so it's unix-like. to be more precise it's a linux distribution. but i doubt you care about the details. it's freely available for download for a wide range of system architectures, including x86 x86_64 , arm , and many more.
you can get it on www.ubuntu.com , instructions to download, and live-cd cration are there. you can run it off the CD without touchging your windows installation (it's rather slow from cd but you can get the idea what it looks and feels like by default, btw you can change look and feel freely)
panda currently supports windows, mac and linux. and there are precompiled packages for ubuntu linux,too. so you can run your panda applications there just like on windows.
if you'r further intrested you might aswell join the #panda3d irc channel on freenode so we can have a chat there  or google for the terms: linux, ubuntu , distribution , open source.
-

ThomasEgi
-
- Posts: 2147
- Joined: Fri Jul 28, 2006 10:43 am
- Location: Germany,Koblenz
by cyberdarklore » Tue Nov 10, 2009 9:20 am
The Panda3D version 1.6.2 that I'm using has the egg2flt.exe tool in the bin directory and the version of Blender is currently use 2.49b allows you to import .FLT models, from what i can see the model is not broken geometry wise, but they show up completely black when displayed in blender, and the UVs seem to be intact for what it imports.
other formats that Blender supports with out plugins and Panda3D converts using bin tools are:
(.dxf)Autodesk DXF, no UV on Import but model seems intact a few missing faces here and there.
(.x)DirectX...Dosent work for me imported model looks like it went through a blender
(.flt)Open Flight, The one were talking about, only imports one object from model maybe that is all thats there after egg2flt.exe is my guess? whould have to see if a seperate model viewer can find the missing objects in .flt file.
[edited](.lwo)LightWave, can convert 2egg but no egg2lwo.exe app yet[edited]
I havnt tryed any import plugins for blender to import any other format panda3D tools support like (.maya) Don't think there will ever be a plugin for blender, but who knows we could always cross are fingers.
 And thanks for solving my ubuntu quandary, Ill look into it sound like a nice alternative shell to install on my system as a duel boot.
 On a side note the only other avatar i have found that compares too yours is this, Both brings a smile to my face. 
-

cyberdarklore
-
- Posts: 13
- Joined: Sat Nov 07, 2009 7:29 am
by ynjh_jo » Fri Nov 20, 2009 4:50 am
I've found task's "time" attribute error trigger.
It's the PauseResume module tries to add the function back to taskMgr, so you used to get a brand new task each time you resume.
I've implemented better solution for this, so here it is.
[_v0.3.7_] [X] fixed log's notify-check task name so it won't be destroyed
[X] improved PauseResume module to pause & resume tasks better than ever, by temporarily moving them to a special task chain with 0 frameBudget, so they won't be ran at all, and the uponDeath function is not called on pause
[X] if after running your main module, there isn't any usable window yet, a dialog will pop up offering you to create a default one. If you'd like to create one by your code, just ignore this dialog. It will be closed automatically after the window is created.
[X] all user-created events accepted by ShowBase (base.accept) will also be removed on scene cleanup
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by rdb » Fri Nov 20, 2009 10:35 am
Great, thanks!
Still having some trouble when editing the code, saving and pressing F11 though. This is my log:
http://pastebin.com/f62a6e377
I prefer e-mail over PM
-
rdb
-
- Posts: 8547
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by ynjh_jo » Fri Nov 20, 2009 11:19 am
What is IDErun() doing in Carousel sample ?
Did you change run() to it ? And why ?
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by rdb » Fri Nov 20, 2009 11:57 am
Oops. Changed it because of this console message:
- Code: Select all
INFO: run() is not here, use IDErun() instead.
So I figured I had to replace my run() by IDErun(). But everything seems to work now.
May I suggest a small enhancement - besides being able to specify the main file to run, it would be nice if I could specify the console arguments to pass to the program as well.
Also, do you happen to do funny stuff with the model-path or so, because two of the more complex games I run fail to load something like a font or a shader (they both have custom resource-loaders I think). It is not a CWD issue as I can run the games from any working directory.
Or maybe it's because sys.argv[0] is not taken relative to the right dir? Maybe it's an idea to make that absolute to be certain that it works.
I prefer e-mail over PM
-
rdb
-
- Posts: 8547
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by ynjh_jo » Fri Nov 20, 2009 1:17 pm
That message is only meaningful when you're at python prompt.
That's why I don't mention it at all in my 1st post, and only use INFO level, not ERROR or WARNING.
Yes I clear model path when setting a file to be the main module, in IDE_setAsMainFile. And then the cwd is appended. That works with all manual shader samples.
How do you define your modelpaths, using local .prc or by code ?
One fail case I know is GMT's heightfield image loading.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by rdb » Fri Nov 20, 2009 2:24 pm
One project does it via a local .prc, one other does it via code, I think.
Could the IDE maybe better prepend to the model path, rather than replace it?
I prefer e-mail over PM
-
rdb
-
- Posts: 8547
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by ynjh_jo » Sat Nov 21, 2009 12:18 am
If I don't clear it, those paths would be accumulated and might slow down panda loader at the end of the day.
Clearing it only removes local paths, and leaves only the paths in the master prc.
Does panda auto-load local .prc, without involving any code ?
If not, then you should be fine. The clearing happens before the main module is ran, so any addition to modelpath by code should work naturally.
Give me some simple samples to investigate.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by rdb » Sat Nov 21, 2009 2:17 am
I found out that I don't have to mess with the model-path at all to reproduce the behavior. I've just emailed you an example that fails for me in the IDE, but runs fine normally.
I prefer e-mail over PM
-
rdb
-
- Posts: 8547
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by ynjh_jo » Sat Nov 21, 2009 5:31 am
Never use Shader.load directly, it disregards modelpaths.
The correct way is loader.loadShader.
I thought you already aware of the difference.
Wonder why the samples and manual are so misleading.
'bout the cmd line args, is this good :
python I_S.pyw file1 file2 file3 -a arg1 arg2
Anything after -a would be passed to the 1st python file.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by rdb » Sat Nov 21, 2009 5:49 am
I'm well aware of the difference between Shader.load and loader.loadShader. But now I remember why I used it - as one of my games has it's own resource location code it doesn't actually *want* to allow people to put different shaders with the same name on the model-path.
The other game project (that messes with model-path in code) already uses the ShowBase loader, but still fails right away when trying to load the font. I'm gonna see if I can write a small test program to reproduce that.
It's not hard to replace it by the ShaderPool (or loader) equivalent, but it would be cool if the IDE could still allow people to load shaders like this.
I've found that if I replace the Shader.load call, the IDE runs perfectly well but the particle system chokes on the same problem also (it loads some stuff directly via the VFS), so when I fire my gun it still errors out.
The suggestion for the '-a' option sounds great.
Once again, thanks for making this awesome editor! 
I prefer e-mail over PM
-
rdb
-
- Posts: 8547
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by ynjh_jo » Sat Nov 21, 2009 6:54 am
Ah, lucky you mentioned vfs, that's indeed the problem.
I just need to sync its cwd in IDE_setAsMainFile, after os.chdir, just to keep it neat :
VirtualFileSystem.getGlobalPtr().chdir(Filename.fromOsSpecific(APP_CWD))
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by rdb » Sat Nov 21, 2009 7:32 am
Hm, for some reason that function never gets executed in the case of the zipfile I sent to you.
Also, a minor suggestion: my game uses relative mouse mode to look around, which makes me unable to click somewhere in the code file. I think it would be a nice idea to have the editor automatically re-enable MAbsolute mode when you switch to the editor, and set it back when you press F5 again.
I prefer e-mail over PM
-
rdb
-
- Posts: 8547
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by ynjh_jo » Sat Nov 21, 2009 9:47 am
Of course, just insert it also before APP_MODULE() in IDEmini.py.
You can help yourself up by setting the mouse mode in IDE_goBackToIDE and IDE_jumpToScene.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ynjh_jo » Tue Nov 24, 2009 2:22 am
[_v0.3.8_] [X] fixed IDE PGTop to use the newly created mouseWatcher and disable the default & user-created button throwers, if you recreate the panda window
[X] fixed persistent settings due to incomplete split of IDE core code
[X] fixed slider page up/down skin visibility on document switch
[X] added arguments passing to the main module, via command line (after -a option) or by setting as main file with options
[X] now the CWD for each file is remembered, the same goes for the arguments, so you set them once and forget it
[X] saving-as-duplicate now also transfers all of the current file properties
[X] added mouse mode restoration on jump to scene
[X] window is set to foreground after closing any wx frame
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ynjh_jo » Sun Nov 29, 2009 1:13 am
[_v0.3.9_] [X] fixed a bug (key error due to the user module not found in sys.modules) in PauseResume
[X] moved CWD (python's and VFS') adjustment from setting as main file to before scene update
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by Wendigo » Tue Dec 08, 2009 3:36 pm
The screenshots look very cool but i could not manage to start it (Ubuntu 9.10)
I get the folowing Error when i try to run
"python IDE_STARTER.pyw"
- Code: Select all
Traceback (most recent call last): File "IDE_STARTER.pyw", line 1187, in <module> panelSize=welcomeScreenPanel.Size AttributeError: 'Panel' object has no attribute 'Size'
-
Wendigo
-
- Posts: 5
- Joined: Sat Dec 05, 2009 11:49 am
by rdb » Tue Dec 08, 2009 3:40 pm
You're running it with wxPython 2.6. You should install the "python-wxgtk2.8" package.
I prefer e-mail over PM
-
rdb
-
- Posts: 8547
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by Wendigo » Wed Dec 09, 2009 12:33 pm
Strange, Synaptic says python-wxgtk2.8 is installed.
Do I have to activate it somehow?
-
Wendigo
-
- Posts: 5
- Joined: Sat Dec 05, 2009 11:49 am
by rdb » Wed Dec 09, 2009 12:59 pm
Huh, maybe it's still accidentally picking up wxPython 2.6? Try removing the package "python-wxgtk2.6".
I remember I had the same problem as you, too - I think this fixed it for me.
I prefer e-mail over PM
-
rdb
-
- Posts: 8547
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
Return to Code Snippets
Who is online
Users browsing this forum: ninth and 0 guests
| | |