Previous Thread  Next Thread

chat icon Problems with importing data set in Blender 2.49

Eine_Kleine_Hexe

Posted: Wed Aug 22, 2012 2:28 pm
Joined: 22 Aug 2012
Posts: 2
Hi,
I've just have started to work with Blender and have a problem with importing data in it...

I have a point cloud data and importing it to Blender via Python script

import cPickle
import Blender
import numpy as np


from deflectometry.geometry.mesh import Mesh


def visualize(fn):
pts = cPickle.load(open(fn,"rb"))

# Bring the points to blender
m = Mesh()
pts = np.asarray(pts)

# pts /= 1000.maybe when converting from mm to blender units
m.verts = pts
return m.to_blender(fn[:-4])
visualize("result.pck")

With the first variant of pts representation it gives an error. With the second one there is no error, but data is not displayed at all... What could be wrong here? Sad
Reply with quote


stiv

Posted: Wed Aug 22, 2012 7:18 pm
Joined: 05 Aug 2003
Posts: 3497
Using a Code tag would help preserve the indentation.

I don't see what you mean by 1st & 2nd variants.
Reply with quote


Eine_Kleine_Hexe

Posted: Wed Aug 22, 2012 9:43 pm
Joined: 22 Aug 2012
Posts: 2
stiv wrote:
Using a Code tag would help preserve the indentation.

I don't see what you mean by 1st & 2nd variants.


Under the first variant I mean not commented equation for pts _and under the second - commented instruction for calculation

In both cases Blender just doesn't react on the starting of the script....
Reply with quote


stiv

Posted: Wed Aug 22, 2012 10:58 pm
Joined: 05 Aug 2003
Posts: 3497
It looks like (hard to tell without the indentation) you are creating stuff inside a function which returns something, but you never assign that something to a variable. In the meantime, everything inside the function has gone out of scope and disappeared.
Reply with quote


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