Extracting parts of interest of a .blend scene

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

barcodepandora
Posts: 6
Joined: Sat Sep 01, 2012 10:52 pm

Extracting parts of interest of a .blend scene

Postby barcodepandora » Mon Oct 01, 2012 4:40 pm

Hello. I resolved the problem of import a large .blend scene. Now I'm trying to extract parts of interest of the scene.

For example, I wish in a Big Buck Bunny scene extract only the scene where the rabbit stretches early out its hole, only the rabbit character. But I don't know how to do it.

I tried deleting parts in the Outliner; or appending/linking parts of the model in a new scene. But I didn't find where are the parts or how to apply the correct frames. I'm researching too, but I didn't find something about it yet.

¿Where I can find more about extract parts of scenes, or how I can get an approach to use or apply the parts of scene I'm interested? Thank U again (.

p9
Posts: 3
Joined: Sun Sep 16, 2012 6:17 pm

Postby p9 » Thu Oct 04, 2012 5:22 pm


barcodepandora
Posts: 6
Joined: Sat Sep 01, 2012 10:52 pm

Postby barcodepandora » Fri Oct 05, 2012 11:23 pm

hello, thank U, i looked it, but i didn't have luck ). When i try to run the export in my python script, console says "context is incorrect".

also i think it must be an easy way to extract a portion of scene for a character, and a given frames of beginning and end, exploiting the qualities of reuse of Blender.

my idea is to try to locate the exact datablocks for append/link and generate the animation, such as:

bpy.ops.wm.link_append(directory=MODELS_PATH + "/models/rabbit.blend/Object/", filename="rabbit", link=False)

import and object datablock. Also, reading the links about export, I think I must locate the exact datablocks of rig and textures to export them.

For the .blend scenes, it has been too complex review the structure of scenes, and get the contents for export and import. Furthermore I don't have the knowledge I need to use this models and the goal is to do it via background with python.

I keep trying. ¿Also p9 or somebody knows how to do it? I will receive it so gladly. Thank U again.

barcodepandora
Posts: 6
Joined: Sat Sep 01, 2012 10:52 pm

Postby barcodepandora » Mon Oct 08, 2012 6:18 pm

hello, I think I'm close. I looked some panels like NLA and DopeSheet, but I don't obtain the information I need.

Looking Outliner panel, I obtain the objects and actions I need. Now my idea is, appending/linking between blocks, I wish to obtain and Outliner status like Outliner of the original .blend scene.

Appending/linking the block to the new scene, I obtain in the Outliner the block, but without linkings.

I link in 3D panel va menu Object > Animation > Bake Action. I enter the frames and in Bake Data Pose. Now I go to Outliner and in the object block appears "Animation", and I enter Set Actions, and I enter the action I wish to see.

Now I obtain a new Outliner like original Outliner. But when I play the scene in Timeline panel, the animation doesn't appear.

¿I do well? ¿What to do to show the object and its action? Thank U again. -now I visit blenderchat (.

p9
Posts: 3
Joined: Sun Sep 16, 2012 6:17 pm

Postby p9 » Fri Nov 02, 2012 1:57 pm

Hi I'm trying this with a blend with a armature an action

Code: Select all

import os
import bpy
import pickle

texto = os.path.join(os.path.dirname(bpy.data.filepath), "tomaya")


def save():
    f= open('tomaya', 'w')
    x=bpy.data.actions['guantazo_izq']
    pickle.dump(x, f)
    f.close()

def load():
    f= open('tomaya', 'rb')
    x = pickle.load(f)
    print(x)
    f.close()


I use save() and it create a archive in my directorie but load not run

TypeError: bpy_struct.__new__(type): expected a single argument


Return to “Python”

Who is online

Users browsing this forum: No registered users and 2 guests