|
|
|
Return to Code Snippets
by rdb » Fri Dec 12, 2008 1:31 am
In case it's related to playing videos: I think I can explain what could be wrong. Panda has two choices for playing videos: ffmpeg and OpenCV. The 1.6.0 pre build includes OpenCV and not ffmpeg -- contrary to all the linux and windows builds, which just include ffmpeg.
I had to link OpenCV to OSX's QuickTime libraries, so I assume Panda is picks OpenCV to play the videos which for some reason fails.
There probably is a bug in Panda's OpenCV interface.
I could be entirely wrong though.
I prefer e-mail over PM
-
rdb
-
- Posts: 8545
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by ynjh_jo » Fri Dec 12, 2008 6:01 am
Perhaps the copy to RAM process is simply queued until next frame.
Did you enable threading in your build ? I haven't tried it with threading enabled. I'm using 1.6.0 too on Linux, 1.5.3 on Windows, both are fine.
In shootScene(), try to insert these lines :
- Code: Select all
while not cardTex.hasRamImage(): renderFrame()
after this line : - Code: Select all
cardTex=IDE_sceneCapture.getTexture()
See if it fix the problem, or stall instead. If it failed, then it must be RTMCopyRam mode in addRenderTexture() doesn't do its job well. You could also try this : insert : - Code: Select all
cardTex=Texture()
before addRenderTexture() line, and pass cardTex instead of Texture() to it, and drop this line : - Code: Select all
cardTex=IDE_sceneCapture.getTexture()
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by fprimex » Mon Dec 15, 2008 9:12 pm
I tried both suggestions and unfortunately, while the program does not outright crash, it is not running correctly. The scene pops up correctly for a split second before showing this:
http://www.fprimex.com/files/panda-ide.png
Thanks for looking into this, by the way.
-
fprimex
-
- Posts: 10
- Joined: Wed Jan 02, 2008 9:42 pm
-
by ynjh_jo » Tue Dec 16, 2008 12:42 am
Wow, outrageous !!
For how long was that screen displayed ?
I assume it's forever, since you even got a chance to shoot it.
If so, it means the texture couldn't be copied to RAM at all. Otherwise, I don't know what else to say. I recall it happened to me long time ago on Windows, long before this IDE was born. I can't remember the responsible code caused that, all I remember is it was only some part of the texture got scrambled, not entirely.
And I can't duplicate the problem. I guess you're so lucky.
Normally, I don't need to copy it to RAM at all. It's just temporary work around the RTT problem I mentioned here :
http://panda3d.org/phpbb2/viewtopic.php?t=5225
Up to 1.5.3, it works correctly, but in 1.6.0, it's broken.
Meanwhile, just drop the entire RTT code in shootScene(),
comment out this line :
- Code: Select all
# render to texture initialization
until this one : - Code: Select all
IDE_sceneCapture.setTexture(newTex)
and replace them with this : - Code: Select all
IDE_sceneCapture=NodePath()
So, you'll only get blank scene when it's paused, only the IDE itself will be displayed.
[EDIT]:
after seeing your screenshot in real size (before posting, I watched it using my phone), it seems your console's output is mixed with the texture of your scene's shot. I've never seen that before.
Looks like driver issue to me. Do all RTT samples work ?
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ynjh_jo » Wed Dec 17, 2008 9:42 pm
Please ignore my last post.
I just duplicated the problem, but not entirely match your case. I got the same AssertionError : do_has_ram_mipmap_image(n) in shootScene() when the window is minimized.
I fixed it this way :
- Code: Select all
cardTex=IDE_sceneCapture.getTexture() if cardTex.hasRamImage(): ox,oy=cardTex.getXSize(),cardTex.getYSize() p2x,p2y=math.log(ox,2),math.log(oy,2) notP2X,notP2Y=math.modf(p2x)[0]!=.0, math.modf(p2y)[0]!=.0 # print 'ox,oy:',ox,oy, x,y=2**int(notP2X+p2x), 2**int(notP2Y+p2y) # print 'x,y:',x,y oimg=PNMImage() cardTex.store(oimg) newImg=PNMImage(x,y) newImg.copySubImage(oimg,0,y-oy,0,0) newTex=Texture() newTex.load(newImg) IDE_sceneCapture.setTexture(newTex) else: IDE_sceneCapture.removeNode()
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ynjh_jo » Mon Dec 22, 2008 11:33 am
UPDATES :
[X] restored aspect2d's draw bin to "unsorted" upon update
[X] fixed a bug in (un)indent selection of unflattened textlines
[X] fixed redo join lines : the connector and strip spaces setting are saved to edit history
[X] join lines now removes backslash at lines' end
[X] any message in screen center is cleared before displaying other messages
[X] improved polyButton module
[X] improved selection by mouse, cycling back to character mode doesn't start new selection, but restores the selection back to character mode, so you won't lose the selection.
[X] upon setting a file to be the main module, all .pyc under that file's path are removed. It's improved a bit, it's removed only if the .py exists at the same location.
[X] code completion : added "anywhere" match mode
[X] added system's color chooser dialog. If there is selected text, which is a comma-separated sequence of 3 numeric characters, it'll be used as the dialog's initial color, after clamped to 0..255. If they're all in range 0..1, they'll be scaled up to 0..255, otherwise left untouched.
[X] added find and replace, complete with regular expressions. Able to replace in all opened files, as well as filtered files under a directory, recursively. You can choose which files should be processed from the list. No scope selection yet.
Find in all files under directory is not there yet.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ditus » Mon Dec 22, 2008 3:27 pm
 you been a human where i will be glad to meet! it seems your holy circle is flying on your head  a great person in computer graphix science and you never bored my eyes. thx
i think we should make anything which rocks soon with your device 
is the idea of the lenov diing? no!
the aries is already on build 
-

ditus
- Troll
-
- Posts: 277
- Joined: Mon Oct 15, 2007 2:15 pm
- Location: moon
-
by ynjh_jo » Tue Dec 23, 2008 1:59 am
Ahaha, Dirk, thanks for spending your time joking with me. I'm nothing but a hobbyist, you know ?
You speak like you can see through space and time.
Are you a psychic ?
Do you see twin/reversed/sequential numbers everywhere & everytime ?
I do.
[EDIT]:
Oh, look, this post is the #30333 post.
[EDIT]:
my last update was posted at 11:33pm here (+7), or 11:33am at ETC (-5).
How could that be ?
BTW, this IDE is generally a pain killer for me, on both Panda and editing sides.
EDITING side :
Every IDE I've tried has some unbelieveably unique ways in hurting me. I can't do this or that, or have to do it in weird way. At the end I can only sighhhhhhhhh.
To mention some (in contrast with mine) :
1. Very small amount of recent files, and there is no way to adjust it.
2. Some IDE's don't save bookmarks, and some forcefully save bookmarks even if I don't want to save the file.
3. I can't easily stop at the edge when cycling over bookmarks, and some IDE's simply forbid me to wrap to the other edge.
4. So far, no IDE I've tried offers me easy macro editing. All of them force me to read the commands reference, since there is no completion for IDE commands itself. It sounds like slouuuuuu hell if I only need to fix my mistakes when recording it, since I'm very aware that I'm just a mistakes factory.
5. So far, no IDE I've tried adjusts the recorded macro commands upon undo/redo, it just runs 1 way straight forward, blindfold without looking back, so I have to go through point (4) if I made mistakes.
6. I don't know if there is IDE which displays indentation helper line only when needed, i.e. when the alignment notch is off the screen. The worst thing is if it's offscreen, I can't even see what it is. So, why don't I just close my eyes instead ? Opening my eyes wouldn't change anything.
7. I don't know if there is IDE which shows me other than start-matched completion.
8. Any other IDE's do multiple lines operation only on lines which have at least 1 selected character in it.
Imagine this, I put the cursor at the 1st column, and then select 2 lines downward, the line on which the cursor is now, won't be included in the process. Now imagine if I do that in a macro, and I don't put the cursor first at the first column, the result will be different at macro replay time.
Case 1: cursor is at column #1, there will be 2 processed lines
Case 2: cursor is at column #2, there will be 3 processed lines !!!
PANDA3D side :
If I use large models or textures, I need to load them only once at first, and the next scene updates will load them from the pools. So, I don't have to waste my time waiting my scene loaded from disk, each time I want to see some changes. This saves lots of time when debuging or developing shaders.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ynjh_jo » Tue Dec 23, 2008 4:43 am
CRITICAL UPDATE:
[X] fixed an old bug in wx's modal dialog on Linux
[X] used other bitmap for button which doesn't exist on Linux
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ditus » Tue Dec 23, 2008 5:40 am
 yes let me see through my glassphere , ohmmmmm, wait... ,yes i can see something...beating your bottom
or wait there is anything else,yes i got i clear,  square numbers
and it seems your hobby will bring you a full stomach...
is the idea of the lenov diing? no!
the aries is already on build 
-

ditus
- Troll
-
- Posts: 277
- Joined: Mon Oct 15, 2007 2:15 pm
- Location: moon
-
by ynjh_jo » Tue Dec 23, 2008 8:13 am
Is it glass sphere or what ? I think I saw something living, breathing in it.
Let me see it closely....
Oh, it's you !
No wonder why the glass is so foggy.
 Keep laughing, man.
Does it matter if I mention that I was born at 11:10am ? So close to 11:11, isn't it ?
Just like on the clock lately, always the last seconds before switching up to the hot one. Just like my post before your last one, 4:43 pm.
This is sooooo OOT, I better stop. CUT !
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ditus » Tue Dec 23, 2008 10:39 am
11:10 -> 1110 = 14 (dual) = AH reverd HA  the smile is sticking on your face;)
is the idea of the lenov diing? no!
the aries is already on build 
-

ditus
- Troll
-
- Posts: 277
- Joined: Mon Oct 15, 2007 2:15 pm
- Location: moon
-
by ynjh_jo » Tue Jan 13, 2009 3:58 pm
Eventhough this is my own IDE, I have a dislike list about it :
[>_<] When loading a file for the 1st time, I need to create all lines at once, and flatten each line, which takes a lot of time for thousands lines files (could be a minute). There is a dilemma about this process. If I flatten it at file loading, it takes too much time. If I flatten it later at their first appearance on the screen, there is chug upon page scrolling, if most of them aren't flattened yet. If I don't flatten them at all, it's a slideshow, not interactive anymore.
[>_<] To avoid text regeneration for files were previously opened, I created .bam cache. Those .bam's are also exist at the same time in RAM as BamStream, so it consumes so much RAM, and several hundreds MB of disk space (10 MB for 200 KB file).
[>_<] Since text flattening takes so much time for thousands lines, it's impossible to highlight multiple-lines string. Say I typed three quotes, then it means I have to highlight (means regenerate) the rest of the lines (could be thousands). Shoooooot, who has the patience for that ?
[>_<] If I select many lines and copy, then paste them, I have to wait again. eeewwwww...
So, it's a very very pathetic situation, and limiting my IDE to do things I need, it only makes me mad.
Then I realized that I'm just circling around the REAL problem, which is slow flatten process, which does so much things.
But, wait......,
there is still hope, and I hope it's not too late for a new year present.
Here I present v0.1, and NOT without any good reason, since...
ALL THINGS IN THAT LIST ABOVE
HAVE GONE !!
Why didn't I do it this way since the first place ?
I can't believe I'd been a morron for almost a year.
Here's how it's done now :
[^_^] Letters quads in a line are generated by directly creating 1 geom and a vertex data and fill it with their vertices. Even in Python, it's faster than flattening (in C++) colorScaled letters quads.
For 5000+ text lines) :
(_hilighter_ON) : 15% faster
(_hilighter_OFF) : 17% faster
And once I generate the text in C++, it can go 4.5x (avg.) faster than that. YYhhhhaaaahahahaha.....
[^_^] only onscreen text lines are generated
[^_^] if a text line is already displayed, it won't be regenerated again upon editing other line or page scrolling, unless it must be differently highlighted
[X] Now, loading any file takes only a couple seconds.
[X] It's now RAM and disk friendly, since the text regeneration is not so expensive, so I don't need .bam cache.
You can freely remove your hundreds-MBytes "docsTextCache" directory.
OTHER UPDATES :
[X] fixed indentation notch closeup viewport's sort order
[X] fixed unindent : if the selected lines are already flushed left, it won't be recorded in edit history, so if undone, it'll be restored correctly
[X] fixed a bug in exception handler
[X] the user alerter code is called only if the erroneous file is successfully loaded
[X] smarter break line undo
[X] Replace remembers what the current file was, since other file might be set as current one when it causes a runtime error.
[X] added wildcards in Find
[X] added context menu in the workspace
[X] improved submenu placement
[X] since I don't need to save each text line anymore, I can switch the hilighter on and off anytime I want.
[X] changed some highlighter colors
REFACTORED syntax highlighter :
[_1_] now ignores single quotes inside triple quotes, and escaped quotes inside quotes (both single and triple)
[_2_] numeric characters are highlighted, integer and float use different color
[_3_] docstring (triple quoted) uses different color than ordinary string (single quoted)
Last edited by ynjh_jo on Tue Jan 13, 2009 4:22 pm, edited 1 time in total.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by drwr » Tue Jan 13, 2009 4:05 pm
Letters quads in a line are generated by directly creating 1 geom and a vertex data and fill it with their vertices.
Note that, as of the current cvs version, this is the way that Panda also generates text internally--it no longer generates a long list of Geoms and flattens them together. So you might want to compare the performance of your new algorithm to raw Panda text generates on the trunk. Your other optimization approaches (generate only onscreen text, avoid unnecessary regenerates) are still great ideas, though.
David
-
drwr
-
- Posts: 11253
- Joined: Fri Feb 13, 2004 12:42 pm
- Location: Glendale, CA
by ynjh_jo » Tue Jan 13, 2009 4:29 pm
Well, I don't use Panda's TextNode since the 1st place for these reasons :
1. I want fixed-width spacing, even if using non-monospace font.
2. I don't want to spend the time to insert the color property change into the string.
3. and I guess I'll need more flexibility in the future.
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by Shaba1 » Wed Jan 14, 2009 11:12 pm
I wanted to try this IDE but when I execute IDE_Starter.pyw I get an error that says "No module named wx". I am using windows xp and have installed "wxPython2.8-win32-unicode-2.8.7.1-py25.exe" All other wxpython programs that I have tried to run seem to work. Does anyone have any idea what is going wrong?
-
Shaba1
-
- Posts: 195
- Joined: Sat Sep 24, 2005 1:26 pm
by ynjh_jo » Wed Jan 14, 2009 11:31 pm
Under your site-packages, it's instaled in wx-2.8-msw-unicode folder.
All you need to do is create a file in site-packages :
- Code: Select all
wx-2.8-msw-unicode
and save it as wx.pth
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by Shaba1 » Wed Jan 14, 2009 11:46 pm
ynjh_jo wrote:Under your site-packages, it's instaled in wx-2.8-msw-unicode folder. All you need to do is create a file in site-packages : - Code: Select all
wx-2.8-msw-unicode
and save it as wx.pth
That file with that text is already in the site-packeges directory. I get the same message.
-
Shaba1
-
- Posts: 195
- Joined: Sat Sep 24, 2005 1:26 pm
by ynjh_jo » Thu Jan 15, 2009 3:26 am
Do you have multiple Python installations ?
Did you use the same python executable when running your other wxpython programs ?
Maybe pythonw.exe executes the other python.exe
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ynjh_jo » Thu Jan 15, 2009 1:26 pm
UPDATES :
[X] join lines is disabled for read only files
[X] replace all in current file and undo replace are now a blink away, since I forgot to disable display update. >_<
2300 lines, 1200 occurences : 0.3 sec (used to be 5+ secs)
9400 lines, 5100 occurences : 1.6 secs
[X] refactored move lines to get faster undo & redo, especially if movement delta is large
[X] changed confirmation message for exit without save
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by Shaba1 » Thu Jan 15, 2009 2:56 pm
ynjh_jo wrote:Do you have multiple Python installations ? Did you use the same python executable when running your other wxpython programs ? Maybe pythonw.exe executes the other python.exe
Yes I do have multiple python installations. I have python 2.2,2.4 and 2.4 installed in seperate directories
Here is my python path
PYTHONPATH=C:\PYTHON25;C:\PYTHON25\DLLS;C:\PYTHON25\LIB;C:\PYTHON25\LIB\LIB-TK;C
:\PYTHON24;C:\PYTHON24\DLLS;C:\PYTHON24\LIB;C:\PYTHON24\LIB\LIB-TK;C:\PYTHON22;C
:\PYTHON22\DLLS;C:\PYTHON22\LIB;C:\PYTHON22\LIB\LIB-TK
-
Shaba1
-
- Posts: 195
- Joined: Sat Sep 24, 2005 1:26 pm
by rdb » Thu Jan 15, 2009 2:59 pm
Ahgr. Sounds like trouble.
You don't have Panda's copy of python on your pythonpath? Just make sure you installed the copy of Wx into the version of Python which you are running.
I prefer e-mail over PM
-
rdb
-
- Posts: 8545
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by Shaba1 » Thu Jan 15, 2009 3:01 pm
pro-rsoft wrote:Ahgr. Sounds like trouble. You don't have Panda's copy of python on your pythonpath? Just make sure you installed the copy of Wx into the version of Python which you are running.
Wx is installed under the c:\python25\Lib\site-packages directory. That is also where wxpath is install
Last edited by Shaba1 on Thu Jan 15, 2009 3:11 pm, edited 1 time in total.
-
Shaba1
-
- Posts: 195
- Joined: Sat Sep 24, 2005 1:26 pm
by rdb » Thu Jan 15, 2009 3:09 pm
Uhm... You installed the 2.5 wxPython binaries into the Python 2.3 directory? Woah, no wonder it doesn't work.
Install the Wx package either in Panda's copy of python (c:\Panda3D-ver\python\site-packages), or, in your Python 2.5 copy. Or, into both, if you aren't sure which one you're actually using.
But I really recommend uninstalling all copies of python. Panda ships with its own copy of 2.5.
I prefer e-mail over PM
-
rdb
-
- Posts: 8545
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by Shaba1 » Thu Jan 15, 2009 3:11 pm
pro-rsoft wrote:Uhm... You installed the 2.5 wxPython binaries into the Python 2.3 directory? Woah, no wonder it doesn't work.
Install the Wx package either in Panda's copy of python (c:\Panda3D-ver\python\site-packages), or, in your Python 2.5 copy. Or, into both, if you aren't sure which one you're actually using.
But I really recommend uninstalling all copies of python. Panda ships with its own copy of 2.5.
No sorry pro-rsoft that was a typo when I was typing in the directory path. It should have been C:\Python25\Lib\site-packages.
-
Shaba1
-
- Posts: 195
- Joined: Sat Sep 24, 2005 1:26 pm
by rdb » Thu Jan 15, 2009 3:16 pm
Then make sure you're running that copy of Python...
To be sure:
- Code: Select all
C:\Python25\python blahblah.py
But why not install wx in Panda's python?
I prefer e-mail over PM
-
rdb
-
- Posts: 8545
- Joined: Mon Dec 04, 2006 5:58 am
- Location: Netherlands
-
by Shaba1 » Thu Jan 15, 2009 6:09 pm
pro-rsoft wrote:Then make sure you're running that copy of Python... To be sure: - Code: Select all
C:\Python25\python blahblah.py
But why not install wx in Panda's python?
Because I would rather not have two version of the same package on my HD. I mean its no big deal just reduntant.
-
Shaba1
-
- Posts: 195
- Joined: Sat Sep 24, 2005 1:26 pm
by ynjh_jo » Fri Jan 16, 2009 12:33 pm
.....I made mistakes again.....
[_v0.1.2_]
[X] Upon undo/redo, if you jump back to the page before that undo/redo, the text won't be displayed. In fact, they're already removed, but the page manager believes that they still exist, so they're not drawn.
[X] In TextDrawer.cxx, in the destructor, there are two _letters_uv.clear(); lines. One of them should be _letters_vtx.clear();
[X] import checking is disabled for string (quoted) lines
[X] fixed exception handler to load the .py file if the error is in the .pyc
[X] added revert to saved
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ynjh_jo » Tue Jan 20, 2009 12:00 pm
[_v0.1.3_]
[X] macro manager : exposed smartPaste argument of paste command options, so I can record a macro to insert text before and after the selected text, say forum tags.
E.g. a macro actions to insert quote tags would be :
[_1_] cut
[_2_] type [
[_3_] type /quote
[_4_] goto prev word
[_5_] go left 2 chars
[_6_] paste with keeping cursor position
[_7_] type [
[_8_] type quote=
[_9_] type "
And the cursor will end up exactly between the quotes. But before really using it, you need to edit the macro, to disable "smart paste" option, or else the 2nd-nth selected text lines will be indented following the cursor column.
[X] fixed a bug in undo paste when smartPaste is off
[X] fixed highlighter bug and improved it to colorize invalid numeric sequence differently instead
[X] added 3 color chooser modes to context menu
[X] added matching brackets highlight
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
by ynjh_jo » Thu Jan 29, 2009 8:17 am
[_v0.1.4_]
[X] clamped slider thumb Z size, so it will never be a-hair-thin for thousands lines files, and easier to grab
[X] fixed brackets highlighter to include comments if not using Python highlighter
[X] now you can clear log file, from context menu
[X] added context menu to code description pane to copy it
[X] added select inside brackets
-

ynjh_jo
-
- Posts: 1795
- Joined: Tue Apr 18, 2006 12:41 am
- Location: Malang, Indonesia
-
Return to Code Snippets
Who is online
Users browsing this forum: No registered users and 1 guest
| | |