Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AClockWorkLemon

Pages: [1] 2
1
Python / PySFML hanging on initiation. (pysfml-cython)
« on: May 02, 2012, 04:41:33 am »
Hey all.

Was hoping you could help on this issue. Recently, PySFML has been creating an infinite hang when imported. Some details:

>>> import PySFML
>>> dir(PySFML)
['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__']
>>> for attr in dir(PySFML):
        print attr, getattr(PySFML, attr)

       
__all__ ['sf']
__builtins__ {'bytearray': <type 'bytearray'>, 'IndexError': <type 'exceptions.IndexError'>, 'all': <built-in function all>, 'help': Type help() for interactive help, or help(object) for help about object., 'vars': <built-in function vars>, 'SyntaxError': <type 'exceptions.SyntaxError'>, 'unicode': <type 'unicode'>, 'UnicodeDecodeError': <type 'exceptions.UnicodeDecodeError'>, 'memoryview': <type 'memoryview'>, 'isinstance': <built-in function isinstance>, 'copyright': Copyright (c) 2001-2012 Python Software Foundation.
All Rights Reserved.

Copyright (c) 2000 BeOpen.com.
All Rights Reserved.

Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.

Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved., 'NameError': <type 'exceptions.NameError'>, 'BytesWarning': <type 'exceptions.BytesWarning'>, 'dict': <type 'dict'>, 'input': <built-in function input>, 'oct': <built-in function oct>, 'bin': <built-in function bin>, 'SystemExit': <type 'exceptions.SystemExit'>, 'StandardError': <type 'exceptions.StandardError'>, 'format': <built-in function format>, 'repr': <built-in function repr>, 'sorted': <built-in function sorted>, 'False': False, 'RuntimeWarning': <type 'exceptions.RuntimeWarning'>, 'list': <type 'list'>, 'iter': <built-in function iter>, 'reload': <built-in function reload>, 'Warning': <type 'exceptions.Warning'>, '__package__': None, 'round': <built-in function round>, 'dir': <built-in function dir>, 'cmp': <built-in function cmp>, 'set': <type 'set'>, 'bytes': <type 'str'>, 'reduce': <built-in function reduce>, 'intern': <built-in function intern>, 'issubclass': <built-in function issubclass>, 'Ellipsis': Ellipsis, 'EOFError': <type 'exceptions.EOFError'>, 'locals': <built-in function locals>, 'BufferError': <type 'exceptions.BufferError'>, 'slice': <type 'slice'>, 'FloatingPointError': <type 'exceptions.FloatingPointError'>, 'sum': <built-in function sum>, 'getattr': <built-in function getattr>, 'abs': <built-in function abs>, 'exit': Use exit() or Ctrl-Z plus Return to exit, 'print': <built-in function print>, 'True': True, 'FutureWarning': <type 'exceptions.FutureWarning'>, 'ImportWarning': <type 'exceptions.ImportWarning'>, 'None': None, 'hash': <built-in function hash>, 'ReferenceError': <type 'exceptions.ReferenceError'>, 'len': <built-in function len>, 'credits':     Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information., 'frozenset': <type 'frozenset'>, '__name__': '__builtin__', 'ord': <built-in function ord>, 'super': <type 'super'>, '_': ['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__'], 'TypeError': <type 'exceptions.TypeError'>, 'license': Type license() to see the full license text, 'KeyboardInterrupt': <type 'exceptions.KeyboardInterrupt'>, 'UserWarning': <type 'exceptions.UserWarning'>, 'filter': <built-in function filter>, 'range': <built-in function range>, 'staticmethod': <type 'staticmethod'>, 'SystemError': <type 'exceptions.SystemError'>, 'BaseException': <type 'exceptions.BaseException'>, 'pow': <built-in function pow>, 'RuntimeError': <type 'exceptions.RuntimeError'>, 'float': <type 'float'>, 'MemoryError': <type 'exceptions.MemoryError'>, 'StopIteration': <type 'exceptions.StopIteration'>, 'globals': <built-in function globals>, 'divmod': <built-in function divmod>, 'enumerate': <type 'enumerate'>, 'apply': <built-in function apply>, 'LookupError': <type 'exceptions.LookupError'>, 'open': <built-in function open>, 'quit': Use quit() or Ctrl-Z plus Return to exit, 'basestring': <type 'basestring'>, 'UnicodeError': <type 'exceptions.UnicodeError'>, 'zip': <built-in function zip>, 'hex': <built-in function hex>, 'long': <type 'long'>, 'next': <built-in function next>, 'ImportError': <type 'exceptions.ImportError'>, 'chr': <built-in function chr>, 'xrange': <type 'xrange'>, 'type': <type 'type'>, '__doc__': "Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil' object; Ellipsis represents `...' in slices.", 'Exception': <type 'exceptions.Exception'>, 'tuple': <type 'tuple'>, 'UnicodeTranslateError': <type 'exceptions.UnicodeTranslateError'>, 'reversed': <type 'reversed'>, 'UnicodeEncodeError': <type 'exceptions.UnicodeEncodeError'>, 'IOError': <type 'exceptions.IOError'>, 'hasattr': <built-in function hasattr>, 'delattr': <built-in function delattr>, 'setattr': <built-in function setattr>, 'raw_input': <built-in function raw_input>, 'SyntaxWarning': <type 'exceptions.SyntaxWarning'>, 'compile': <built-in function compile>, 'ArithmeticError': <type 'exceptions.ArithmeticError'>, 'str': <type 'str'>, 'property': <type 'property'>, 'GeneratorExit': <type 'exceptions.GeneratorExit'>, 'int': <type 'int'>, '__import__': <built-in function __import__>, 'KeyError': <type 'exceptions.KeyError'>, 'coerce': <built-in function coerce>, 'PendingDeprecationWarning': <type 'exceptions.PendingDeprecationWarning'>, 'file': <type 'file'>, 'EnvironmentError': <type 'exceptions.EnvironmentError'>, 'unichr': <built-in function unichr>, 'id': <built-in function id>, 'OSError': <type 'exceptions.OSError'>, 'DeprecationWarning': <type 'exceptions.DeprecationWarning'>, 'min': <built-in function min>, 'UnicodeWarning': <type 'exceptions.UnicodeWarning'>, 'execfile': <built-in function execfile>, 'any': <built-in function any>, 'complex': <type 'complex'>, 'bool': <type 'bool'>, 'ValueError': <type 'exceptions.ValueError'>, 'NotImplemented': NotImplemented, 'map': <built-in function map>, 'buffer': <type 'buffer'>, 'max': <built-in function max>, 'object': <type 'object'>, 'TabError': <type 'exceptions.TabError'>, 'callable': <built-in function callable>, 'ZeroDivisionError': <type 'exceptions.ZeroDivisionError'>, 'eval': <built-in function eval>, '__debug__': True, 'IndentationError': <type 'exceptions.IndentationError'>, 'AssertionError': <type 'exceptions.AssertionError'>, 'classmethod': <type 'classmethod'>, 'UnboundLocalError': <type 'exceptions.UnboundLocalError'>, 'NotImplementedError': <type 'exceptions.NotImplementedError'>, 'AttributeError': <type 'exceptions.AttributeError'>, 'OverflowError': <type 'exceptions.OverflowError'>, 'WindowsError': <type 'exceptions.WindowsError'>}
__doc__ None
__file__ C:\Python27\lib\site-packages\PySFML\__init__.pyc
__name__ PySFML
__package__ None
__path__ ['C:\\Python27\\lib\\site-packages\\PySFML']
>>> from PySFML import sf
(hangs here)
 

I've just reinstalled a clean copy of python, and copied across a clean build of PySFML which i know has worked previously.

If you need any more info, just ask :)

Any help would be greatly appreciated!
I would be moving across to PySFML2-cython, however i'm on a bit of a tight schedule, and don't have the time to recode large parts of my helper libs.

Many thanks in advance, AClockWorkLemon

2
Graphics / Image load error reporting incorrect size
« on: February 13, 2012, 08:45:43 am »
Ah, i see. Thanks for the clarification.

3
Graphics / Image load error reporting incorrect size
« on: February 13, 2012, 08:14:58 am »
Heya!

In an application i'm working on, on some hardware it is throwing an error when trying to load high resolution errors
Code: [Select]
Failed to create image, its internal size is too high (4096x4096)

I've already googled around, and know that this is to do with the graphics card is not powerful enough to load such a large image, however none of the images themselves are 4096x4096. The particular image i was testing on is one of the largest, and is ~3000x~2000.

I realise that this most likely has no effect on the actual error, however i was wondering if anyone would be able to explain the incorrect reporting of the image size.

If it is of any help, i am running PySFML 1.6, compiled from the latest Trunk revision in python 32 bit.

4
Graphics / 'Blobby' fonts
« on: December 08, 2011, 09:17:05 pm »
Quote from: "Laurent"
http://www.sfml-dev.org/forum/viewtopic.php?p=36367#36367

My apologies.

I think i've got it sorted now, i was unaware that loading a font at a larger size than was needed would have adverse effects on quality. If that does not fix it, i'll make sure to provide a proper example that reproduces it properly :)

Sorry again, ACWL

5
Graphics / 'Blobby' fonts
« on: December 08, 2011, 01:13:43 pm »
Heya, was wondering if you guys could help.

Project i'm working on has need of fonts, however most text rendered seems to be coming out a little.. 'blobby'. Not sure really how to put it, so here's a picture:



The font is Gotham-book
This is the "Text" class i'm using to handle fonts etc:

Code: [Select]

class Drawable(object):
def render(self, win, offset=Point(), camera=Point()):
self.SetPosition(self.x+offset.x-camera.x, self.y+offset.y-camera.y)
win.Draw(self)

class Text(sf.String, Drawable):
def __init__(self, text, font, size):
self.font = GetFont(font, size)
sf.String.__init__(self, text, self.font, size)
self.x = 0
self.y = 0

fontCache = {}
def GetFont(loc, size):
try:
fnt = fontCache[loc]
old_size = fnt.GetCharacterSize()
if size < old_size:
return fnt
except KeyError: pass
Font = sf.Font()
if not Font.LoadFromFile(loc, size):
return None
fontCache[loc] = Font
return Font


If you need more, please feel free to ask ^_^

thanks in advance :)

6
Python / [Solved] How to load sf.Images in a separate Thread/process?
« on: October 21, 2011, 03:24:01 am »
Oops, never mind. Error my end. Thanks for that, much appreciated!

And no, i haven't done any work on this in C++. My mind just doesn't handle it well enough yet ^_^

7
Python / [Solved] How to load sf.Images in a separate Thread/process?
« on: October 20, 2011, 02:46:44 am »
Thanks for that. The main issue is that the first screen will be showing them all. And also, i don't have anything else to do while the images load :/

I already have the "Thumbnail" objects checking a dict to see if their Image has been loaded. Currently, because the images are all loaded in-line, they all appear at once. I was wondering if it would be possible to split a thread/process off to load the images, and put references in the dict (or whatever) so that the Thumbnails all load with the "loading" image, which is replaced by the final image once it has been loaded. Obviously for this to work, the SFML loop would need to be running...

Not sure how descriptive that explanation is, i'm not sure how to explain it very well.

8
Python / [Solved] How to load sf.Images in a separate Thread/process?
« on: October 19, 2011, 01:53:54 am »
Sorry to bump, but i cannot for the life of me find a working answer :/

Normally the loading of images isn't a huge problem, however for this project, it will need to load some ~270 images, each up to about 5MB in size. Unless i find a way of loading quickly, or loading in a separate process, it is going to be far too slow :/

9
Python / [Solved] How to load sf.Images in a separate Thread/process?
« on: October 14, 2011, 08:05:00 am »
Heya!

I was hoping someone could outline how to load images in a separate thread/process with PySFML. I gave Thread a go, and found that it was blocking the PySFML thread. After searching around for a bit, i found Process, which didn't block the main thread at all. However, i have been unable to send the data of the loaded images to any other threads. (Python interpreter complains about being unable to pickle the Image)

If anyone could help sort out this issue, it'd be greatly appreciated!

10
Python / [ignore] pysfml2-cython build request / weird errors
« on: October 06, 2011, 03:40:25 am »
Durp, my bad. thanks for that :)

11
Python / PySFML 1.6 Fixed build (windows)
« on: October 06, 2011, 02:40:35 am »
Heya all!
For all of you who have been having trouble with PySFML1.6 (both the crash on exit error and the missing SetSmooth functions), this is for you!

This build is built from the 1.6 SVN Trunk, using MinGW32. To use, just replace all the files in your site-packages/PySFML folder with the files in the package (it should be possible to just replace the .pyd, but i cant promise anything)

Download link (Mediafire)

12
Python / [ignore] pysfml2-cython build request / weird errors
« on: October 06, 2011, 02:03:45 am »
Oop, computer got fixed sooner than i had thought. I've build PySFML2 and pysfml2-cython, but i've been unable to get them to work. It would seem everything is missing it's methods or something.

This code:
Code: [Select]
from PySFML import sf
App = sf.RenderWindow(sf.VideoMode(200, 200, 32), "Image Blur Reproduction")
App.SetFramerateLimit(30)


Returns the error
Code: [Select]
AttributeError: 'sf.RenderWindow' object has no attribute 'SetFramerateLimit'
but according to the documentation, it does. Is this an error with compile, or just an error in the current binding?

13
Python / [ignore] pysfml2-cython build request / weird errors
« on: October 05, 2011, 04:16:36 pm »
Hiya people!

I was just in the hopes that someone could build/provide their binaries for PySFML2, Python2.7.

Please do not take this as me being lazy! I would compile myself, however i both lack  something to compile on (my main computer is getting repairs, this computer i don't wish to install compilers on), and confidence.

Thanks in advance!

Ninja edit
Or, if possible, a version of PySFML 1.6 without that stupid Image.SetSmooth issue. that'd be eppppiiccc :D

again, thanks in advance

EDIT
PLEASE IGNORE THIS THREAD! I've got it all sorted now :)

14
Graphics / [solved] Issue with blurring
« on: October 05, 2011, 02:56:43 pm »
Ok, thanks. i'll take a look, see if i can fix it.

15
Graphics / [solved] Issue with blurring
« on: October 05, 2011, 02:20:27 pm »
Oops, forgot to add it in xD
Added it in this time, same results...

Code: [Select]

from PySFML import sf

App = sf.RenderWindow(sf.VideoMode(200, 200, 32), "Image Blur Reproduction")
App.SetFramerateLimit(30)

img = sf.Image()
img.SetSmooth(False)
if not img.LoadFromFile("Ship.png"):
print "Error: Could not load image"
spr = sf.Sprite(img)
spr.SetPosition(80, 92)

bg = sf.Color(194, 194, 194)
while App.IsOpened():
App.Clear(bg)

e = sf.Event()
while App.GetEvent(e):
if e.Type == sf.Event.Closed:
App.Close()

App.Draw(spr)

App.Display()

Pages: [1] 2
anything