This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
def rename_uv_as_objgrp(): | |
for o in bpy.data.objects: | |
for uv in o.data.uv_layers: | |
uv.name = o.name + "_" + uv.name | |
if __name__ == "__main__": | |
rename_uv_as_objgrp() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import bmesh | |
from mathutils import Vector | |
from math import fabs | |
from collections import defaultdict | |
bpy.ops.mesh.select_all(action='SELECT') | |
bpy.context.scene.tool_settings.uv_select_mode = 'ISLAND' | |
obj = bpy.context.active_object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# プログラミング言語の指定 | |
# BlenderのアドオンはPythonで記述するためpythonを指定 | |
language: python | |
# 使用するPythonのバージョン | |
# ★BlenderのPythonコンソールから利用されているPythonのバージョンを特定可能 | |
python: | |
- "3.4" | |
# install前に実行する処理 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import blf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd D:\workspace\blender_dev | |
$ git clone git://git.blender.org/blender.git | |
$ cd blender | |
$ git submodule update --init --recursive | |
$ git submodule foreach git checkout master | |
$ git submodule foreach git pull --rebase origin master | |
$ cd D:\workspace\blender_dev | |
$ svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/win64_vc12 lib/win64_vc12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wm = bpy.context.window_manager | |
kc = wm.keyconfigs.addon | |
# 登録するショートカットキーのリストを作成 | |
# (キーが押されたときに実行する bpy.types.Operator のbl_idname, キー, イベント, Ctrlキー, Altキー, Shiftキー) | |
key_assign_list = [ | |
(ObjectScaleUp.bl_idname, "U", "PRESS", True, True, False), | |
(ObjectScaleDown.bl_idname, "D", "PRESS", True, True, False), | |
] | |
if kc: | |
km = kc.keymaps.new(name="3D View", space_type="VIEW_3D") # 「View3D」のショートカットキーとして登録 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bgl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 'N'キーを押したときにVIEW 3Dの右側に表示されるメニューにボタンを設置 | |
class OBJECT_PT_MKET(bpy.types.Panel): | |
bl_label = "Mouse/Keyboard Event Test" | |
bl_space_type = "VIEW_3D" | |
bl_region_type = "UI" | |
def draw(self, context): | |
# ボタンの配置 | |
# ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{locale: {(context, key): translated_str, ...}, ...} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
translation_dict = { | |
"ja_JP": {("*", "key1"):"hoge"}, | |
"en_US": {("*", "key1"):"test"}} | |
class TranslationTestClass(bpy.types.Operator): | |
bl_idname = "uv.translation_test" | |
def execute(self, context): | |
self.report({'INFO'}, bpy.app.translations.pgettext("key1")) |