Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Not able to use PVector #6

Closed
jarav opened this Issue · 6 comments

2 participants

@jarav

Defining a variable of type PVector gives :
NameError: global name 'PVector' is not defined

@jdf
Owner

Thanks, and good catch. I'll fix it, but you can work around it today by explicitly importing it:

from processing.core import PVector
@jarav

But after doing that, I am getting this:
SystemError: Automatic proxy initialization should only occur on proxy classes

@jdf
Owner

I can't reproduce that problem, and I can't even figure out where that error message might be coming from.

What happens if you run the sketch

from processing.core import PVector
print PVector(1,2,3)

?

@jdf
Owner

If the test code I've provided does work for you, but your code does not, please create as small an example as possible that throws the error, and paste it here. Thanks very much.

@jarav

Really sorry for not giving you the context in which I got the error. Here is the sample code:
from processing.core import PVector
import copy

def setup():
a = [PVector(1,2), PVector(3,4), PVector(5,6)]
b = copy.deepcopy(a)
print b[0]

Also PVector.sub(v1, v2) for PVectors v1 and v2 gives 'None'.

@jdf
Owner

OK, you no longer need to explicitly import core Processing classes in your sketches as of build 0013.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.