Access to 3D data

An open space where people who use Blender in an academic environment can share progress and the typical problems and needs of academic environments.

Moderators: jesterKing, stiv

alfer
Posts: 2
Joined: Mon Mar 22, 2010 7:35 pm

Access to 3D data

Postby alfer » Tue Mar 23, 2010 4:36 pm

I'm working on a dust simulation that I think blender would handle very well. For my calculations I need to extract values in 3D space so they can be equated to densities. I need to do this frame by frame as the simulation progresses. Can anyone tell me if this is possible in blender and point me to where to find info about it.

thanks in advance

ragupta
Posts: 5
Joined: Sun Oct 12, 2008 7:23 pm
Location: Raleigh, NC

Re: Access to 3D data

Postby ragupta » Wed Mar 24, 2010 4:19 am

I am also doing frame by frame simulation and calculation. I have my calculations to be done for each frame in a C program. I use the python script in blender to interact by C program after each frame is rendered. You can do the similar thing I guess.

alfer
Posts: 2
Joined: Mon Mar 22, 2010 7:35 pm

Postby alfer » Thu Mar 25, 2010 5:57 pm

Rgupta, thanks for the reply. That sounds similar to what I'm doing.
First simulate in Blender and then try to use my own code on the data
generated by the simulation.
I am new to blender and I'm just figuring things out as I go. Can you point me to documentation on the python script you are using.

thanks!

myrtil
Posts: 1
Joined: Wed Mar 31, 2010 11:51 am
Location: Pisa

Access to 3D Data

Postby myrtil » Wed Mar 31, 2010 12:39 pm

[quote=
I am new to blender and I'm just figuring things out as I go. Can you point me to documentation on the python script you are using.
thanks![/quote]

If you have a Ipo Curve for every object you want 3D coordinates for:
list_obj= list of objects in the Blender Scene
fr=frame. For example, you're interested in frames between 1 and 100

for fr in range (1,101):
for i in range(len(list_obj)):
ipo = list_obj[i].getIpo() # retrieves an Ipo object
if ipo != None:
icuX = ipo[Ipo.OB_LOCX]
icuY = ipo[Ipo.OB_LOCY]
icuZ = ipo[Ipo.OB_LOCZ]
valx = icux[fr]
valy = icuy[fr]
valz = icuz[fr]


Hope it can be useful

Myrtil


Return to “Academic & Research”

Who is online

Users browsing this forum: No registered users and 4 guests