Created
April 20, 2017 06:25
-
-
Save kamino410/78ce4824d4138d841cfa1ca25b375b2d to your computer and use it in GitHub Desktop.
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
| #メッシュの作製 | |
| mesh = bpy.data.meshes.new("new_mesh") | |
| #点を描画する場合 | |
| mesh.from_pydata([(0,0,0),(1,0,0),(1,1,0)], [], []) | |
| mesh.update() | |
| #加えて線を描画する場合(何番目の点と何番目の点を結ぶかのリストを渡す) | |
| mesh.from_pydata([(0,0,0),(1,0,0),(1,1,0)], [(0,1),(1,2),(2,0)], []) | |
| mesh.update() | |
| #加えて面を描画する場合) | |
| mesh.from_pydata([(0,0,0),(1,0,0),(1,1,0)], [], [(0,1,2)]) | |
| mesh.update(calc_edges=True) | |
| #追加 | |
| object_utils.object_data_add(bpy.context, mesh, name="mesh1") | |
| #pointerを原点に戻す | |
| bpy.context.scene.cursor_location = (0,0,0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment