Maxwell Render

Maxwell Render Information Repository
It is currently Sun May 19, 2013 7:28 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Jul 02, 2012 3:20 pm 
User avatar

Joined: Wed Mar 01, 2006 2:09 pm
Posts: 10
Location: Belgium
Hello,

I'm using (learning) python to create a scene to render in Maxwell, but for some reason I cannot use the Cvector function.
The line :

Code:
base.origin = Cvector.assign (0.5,0.5,1.0);


gives me the following error :

Code:
TypeError: unbound method Cvector_assign() must be called with Cvector instance as first argument (got float instance instead)


I interpret this error as if Cvector.assign(double,double,double) does not exist, but according to the documentation it should.

Any idea what I'm doing wrong here?

Thanks in advance!

Regards,
Willy


Top
 Profile  
 
PostPosted: Mon Jul 02, 2012 4:17 pm 
User avatar

Joined: Tue Nov 24, 2009 4:52 pm
Posts: 176
Hello!

"assign" is a Class method (non-static), so you have to call it from the object itself like this:

base.origin.assign(0.5,0.5,1.0);

Another way to do the same, is creating a CVector object with the values you want, setting the base.origin property like this:

base.origin = Cvector(0.5,0.5,1.0);

Both are correct ;)

Hope it helps!

_________________
Next Limit Team


Top
 Profile  
 
PostPosted: Mon Jul 02, 2012 5:43 pm 
User avatar

Joined: Wed Mar 01, 2006 2:09 pm
Posts: 10
Location: Belgium
Hello Brany,

Thanks a lot for your help, it works perfect now !

I should have known this as I work often in Java and C# ... :shock:

Regards,
Willy


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group