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
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