Skip to content

Instantly share code, notes, and snippets.

View nutti's full-sized avatar

nutti nutti

View GitHub Profile
@nutti
nutti / file1.txt
Created July 23, 2015 11:59
[Blender] スクリプトの内部からOpenGLを利用する ref: http://qiita.com/nutti/items/835b745257a79ed215e8
import bgl
@nutti
nutti / file1.txt
Created July 24, 2015 12:49
[Blender] スクリプト内部で自作の機能にショートカットキーを割り当てる ref: http://qiita.com/nutti/items/e29226ff8bd7a7e770aa
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」のショートカットキーとして登録
@nutti
nutti / file0.sh
Created July 27, 2015 12:02
[Blender] ソースコードからBlender本体をビルドする ref: http://qiita.com/nutti/items/2a7d31e224b28142b3d6
$ 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
@nutti
nutti / file1.txt
Last active August 29, 2015 14:26
[Blender] スクリプト内からテキスト描画モジュールを利用する ref: http://qiita.com/nutti/items/82aebaaab0060b470257
import blf
@nutti
nutti / .travis.yml
Created November 17, 2015 12:59
[Blender] GitHubとTravisCIを用いてBlenderアドオンのテストを自動化する ref: http://qiita.com/nutti/items/fe3f3f14168155df5916
# プログラミング言語の指定
# BlenderのアドオンはPythonで記述するためpythonを指定
language: python
# 使用するPythonのバージョン
# ★BlenderのPythonコンソールから利用されているPythonのバージョンを特定可能
python:
- "3.4"
# install前に実行する処理
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
@nutti
nutti / rename_uv_as_objgrp.py
Created May 6, 2016 05:57
Rename UV set as Object Group
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()
@nutti
nutti / space_view3d_screencast_keys_ex.py
Created May 6, 2016 15:57
Screencast Keys Extended
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@nutti
nutti / book.json
Last active July 16, 2016 13:59
[GitBook] GitBookから生成されるPDF・HTMLのデザインを変更する方法 ref: http://qiita.com/nutti/items/96e7194c82b8d04382e2
{
"plugins": ["styles-less"],
"styles": {
"website": "my_website.less",
"pdf": "my_pdf.less"
}
}
@nutti
nutti / shortcut_key_test_muv_cpuv.py
Last active July 19, 2016 11:57
Shortcut key test for Copy/Paste UVs on Magic UV
import bpy
class MyClassCopy(bpy.types.Operator):
bl_idname = "my.own_class_copy"
bl_label = "own class copy"
def execute(self, context):
bpy.ops.uv.muv_cpuv_copy_uv() # CopyUV
return {'FINISHED'}