如何在搅拌机中标记最后导入的* obj [英] How to mark last imported *obj in blender

查看:141
本文介绍了如何在搅拌机中标记最后导入的* obj的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(可能写得不太好)的问题是:有没有办法在通过bpy.import_scene.obj函数加载后立即获取对象数据?

The (probably not so well written) question is: Is there any way to get object data right after it is loaded through bpy.import_scene.obj function?

我的意思是当我用这个函数导入一个obj文件时,我需要为它做一些更多的转换。当我通过名称'Mesh'(导入后的默认对象名称)选择一个对象时,所有这些函数都适用于我场景中名为'Mesh'的其他对象。我试图从场景中的对象列表中获取最后一个对象,但它们按字母顺序排列,因此效果不佳。当我试图更改object.name并将下一个函数应用于它时,它只适用于一个。导入对象的所有早期实例都恢复为默认值。

I mean when i import an obj file with this function i need to make some more transformation for it. When i select an object via name 'Mesh' (default name of object after import) all those functions works for other objects named 'Mesh' in my scene. I tried to get an last object from objects list in scene but they're arranged alphabeticaly, so it didn't worked well. When i tried to change object.name and apply next functions to it, it works only for one. All earlier instances of imported object are back to default.

如何解决这个问题?有没有选择从场景最后添加的对象?或者也许某种方式在应用下一个函数之前导入它后立即标记* obj对象?或者也许有办法将* obj数据直接导入到创建的早期空白对象中。

How to solve that problem? Is there a option to get from scene last added object? Or maybe some way to 'mark' *obj object right after it is imported before next functions are applied? Or maybe there is a way to import *obj data straight into created earlier blank object.

欢呼,
regg

cheers, regg

PS:使用Blender 2.63

PS: Working on Blender 2.63

推荐答案

操作员不会返回他们加载的数据,但您可以使用标记这种方式...

Operators don't return data they load, but you can use tagging this way...

for obj in bpy.data.objects:
    obj.tag = True

bpy.import_scene.obj(filepath="somefile.obj")

imported_objects = [obj for obj in bpy.data.objects if obj.tag is False]

这篇关于如何在搅拌机中标记最后导入的* obj的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆