Previous Thread  Next Thread

chat icon Extracting parts of interest of a .blend scene

barcodepandora

Posted: Mon Oct 01, 2012 3:40 pm
Joined: 01 Sep 2012
Posts: 6
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 (.
Reply with quote


p9

Posted: Thu Oct 04, 2012 4:22 pm
Joined: 16 Sep 2012
Posts: 3
Maybe this will help you

http://www.blender.org/documentation/blender_python_api_2_63_release/bpy.ops.export_anim.html

http://www.blender.org/documentation/blender_python_api_2_63_release/bpy.ops.import_anim.html
Reply with quote


barcodepandora

Posted: Fri Oct 05, 2012 10:23 pm
Joined: 01 Sep 2012
Posts: 6
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.
Reply with quote


barcodepandora

Posted: Mon Oct 08, 2012 5:18 pm
Joined: 01 Sep 2012
Posts: 6
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 (.
Reply with quote


p9

Posted: Fri Nov 02, 2012 1:57 pm
Joined: 16 Sep 2012
Posts: 3
Hi I'm trying this with a blend with a armature an action

Code:

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
Reply with quote


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