Blender 2.5 import problem

I am converting all my game scripts into 2.50, but I ran into a problem, in 1 of the scripts it has:

import Blender

but I guess that is no longer there? Was it renamed or was it replaced?

Heres the full script:

gl = GameLogic
cont = gl.getCurrentController()
own = cont.owner

pos = own.position
objName =[2:]

nodes = {}
nodelist = []

print ("Generating")
import Blender

class node:
    def __init__(self,name,list,pos,next=[]): = name
        self.pos = pos = next
        list[name] = self

def strf(f):
    return str(int(f*10))

def namepoint(v):
    name = strf([0])+","+strf([1])+","+strf([2])
    return name


def trpoint(point,offset=pos):
    return [point[0]-offset[0],point[1]-offset[1],point[2]-offset[2]]

me = Blender.NMesh.GetRawFromObject(objName)
num = 0

for f in me.faces:
    for v in f.v:
        num += 1
        name = namepoint(v)
        if name not in nodes.keys():
            nodes[name] = node(name,nodes,trpoint(
            nodes[name].next = []
        for v2 in f.v:
            if name != namepoint(v2) and namepoint(v2) not in nodes[name].next:

gl.nodes = nodes

### Done ###
print ('Finished!!')

Scripting in 2.50 is completely different from a fundamental basis. The API is also not complete; right now the devs are working on Operators.

I have the same problem now: how can i convert the py-nodes to blender 2.5? I am not able to import nodes. I tried

import bpy
from bpy import *

doesn’t work.

To import bpy.ops.node is not possible. I don’t know why, because this modul is in the documentation of blender 2.57b

How can i solve the problem?


or from text editor :

import bpy