Blender:如何在python中调整uv图像的选定部分的大小?

2024-10-02 10:23:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试选择我的uv图像的一部分。在搅拌机,一切看起来都很好,倾斜“s”+“鼠标调整大小”。在

但是我需要在.py archive做这个。在

使用脚本bpy.ops.转换.resize(…),但是,另一件事发生了!对象与图像大小调整关联,而不是uv图像:(

我怎么能在python上调整uv图像部分的大小?在

我的剧本到现在为止:

def create_score():
#adding empty object
bpy.ops.object.empty_add()
empty_obj = bpy.context.object
empty_obj.name = "score"

#adding score plane
bpy.ops.mesh.primitive_plane_add(radius=1, location=(0.5,6.7,0))
bpy.ops.transform.resize(value=(-8, -8, -8), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

#adding score object1
bpy.ops.mesh.primitive_plane_add(radius=0.5, location=(-6, 7.2, 0.1))
obtext1 = bpy.context.object
obtext1.name = "Score1"
obtext1.select = True
bpy.ops.object.editmode_toggle()
for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        area.spaces[0].viewport_shade = 'TEXTURED'
        area.type = 'IMAGE_EDITOR'
#adding image I want resize
bpy.ops.image.open(filepath="//../../textures/arialbd.tga", directory="/home/camila/Documents/cinemaxd/PlayerXD/textures/", files=[{"name":"arialbd.tga", "name":"arialbd.tga"}], relative_path=True)
bpy.data.screens['UV Editing'].areas[1].spaces[0].image = bpy.data.images['arialbd.tga']
bpy.ops.uv.unwrap()
#selecting all image
bpy.ops.uv.select_all(action='TOGGLE')

在-- 这个

^{pr2}$

也帮不上忙:/


Tags: name图像imageaddobjectareauvops

热门问题