Previous Thread  Next Thread

chat icon Problem with Blender.Set("curframe", n)

oeteo

Posted: Wed Nov 04, 2009 2:47 pm
Joined: 04 Nov 2009
Posts: 2
Hello

I am using Python for the first time and I have a problem

Code:

from Blender import *
from math import *


yields an error for
Code:
Blender.Set("curframe", n)


and

Code:

import Blender
from Blender import *
from math import *


throw errors for functions like acos, asin, etc.

How should I import these things so that I can use both Set and acos functions
Reply with quote


stiv

Posted: Wed Nov 04, 2009 4:39 pm
Joined: 05 Aug 2003
Posts: 1585
As a general rule, doing
from Foo import *
is a bad idea, especially if you are importing more than one module. It jumbles together all the names that should be in separate name spaces and under certain conditions, it will not initialize a module properly unless you do
import Foo
first.

A better style is something like
import Blender as B
import math as M


Then you can call
B.Set('currentframe', n)
m.acos( x )


Note: simply saying something throws an error without mentioning the error makes diagnosing the problem difficult.
_________________
Answers for New Users
Reply with quote


oeteo

Posted: Thu Nov 05, 2009 10:18 am
Joined: 04 Nov 2009
Posts: 2
stiv wrote:


Note: simply saying something throws an error without mentioning the error makes diagnosing the problem difficult.


^_^ I know it but it is just highlighted in red and I don't know how to see the description
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group