import another script

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

celeriac
Posts: 72
Joined: Fri Feb 21, 2003 11:31 pm
Contact:

import another script

Postby celeriac » Thu May 22, 2003 10:29 pm

er, how do i from one script in blender import the code in another script (also in blender) ?
what i'm trying to do is automate the YaBle script to export each frame of my animation with a numbered yafray xml file by invoking its export method from my script.

theeth
Posts: 1184
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Postby theeth » Fri May 23, 2003 2:59 pm

Yable already supports this, I'm the one who coded that feature in.

anyway, the copy/paste shortcuts in Blender are alt-C/alt-V

Martin
Life is what happens to you when you're busy making other plans.
- John Lennon

celeriac
Posts: 72
Joined: Fri Feb 21, 2003 11:31 pm
Contact:

Postby celeriac » Fri May 23, 2003 5:39 pm

Sorry, I didn't make it clear. I have the YaBle script in my project. I want to use YaBle as I would a module; so where I would say 'import whrandom' to use the methods of whrandom in my script, how do I tell python that I'm going to be using methods from the YaBle script ?

I imagine it must be something like:
import yable.py ? but, this isn't it.

I don't want to just paste the entire YaBle script onto the end of my script if I can refer its methods and classes from my script.

celeriac
Posts: 72
Joined: Fri Feb 21, 2003 11:31 pm
Contact:

answer(self)

Postby celeriac » Sat May 24, 2003 1:06 am

ok. I found it. One brings the YaBle script into Blender, runs it, and then one can say 'from Yable import *' in one's script and it works.

Anyway, thankyou Yafray!


Return to “Python”

Who is online

Users browsing this forum: No registered users and 1 guest