import another script?

How do i import a text file (script) that is runing with another runing script?

p.s. is it confuse?:slight_smile:

[edit]
Reformulate:
Is it possible for a script(1) to import another(2), the second is inside a blender file (a text) and the first is created at runtime by the second.
[/edit]

Thank you very much!

I am not sure if in this tutorial is a solution, or part of it but check it out.
http://honors.montana.edu/~jjc/easytut/easytut/node17.html

Thank you, but it’s not that.

I need to get some variables that are changing at runtime. I thought in something like

import B

but it doesn’t work.

can you explain in a but more detail what your doing…
note that if your changing the script your importing (such as development)

do

import fooBar
reload(fooBar)

otherwise it will use the script that was alredy loaded and your changes wont be registered, or it will use the pyc file.

I’m trying to draw in 3Dwindow the chosen points of my Lengthen script, and taking Trajectory script as a learning model.
Here is what i get so far.
http://clientes.netvisao.pt/pconcretos/temp/lengthen_0.18a.zip

I need to get the chosen points to know what to draw. Am i in the right way?

cambo, do you know any example on how to use that function with 2 running scripts at the same time?

Thank you!

1 hint about using 2 scripts at once is that to share variables you can assign variabkles to the Blender module.

This is much faster then the registry and allows you to use Blender Objects etc as variables, though be carefull and give your variable a unique name


import Blender

try:
    Blender.__mynewvar__ = {}
except:
    foobar = Blender.__mynewvar__

Thank you alot, cambo, your knowledge is pure gold :)!

The trajectory.py script is a bit to much because i do not understand some (alot) things that he wrote in there. I can draw a GL_POINT, but cannot work with the matrizes.

Do you know any script link example about how to get a mesh vertice and draw a GL_POINT in the same place, and reacts to 3Dwindow pan and rotation? :slight_smile:

I know i’m asking alot, but maybe it’s easy to you to write an example (or know a tutorial) about this.

Thank you very much!