Skip to content

Instantly share code, notes, and snippets.

View naotohori's full-sized avatar
:electron:

Naoto Hori naotohori

:electron:
View GitHub Profile
@naotohori
naotohori / delete_the_cube.py
Created June 16, 2020 11:24
any difference between save_as_mainfile and save_mainfile?
import bpy
bpy.data.objects['Cube'].select_set(True)
bpy.ops.object.delete()
#bpy.ops.wm.save_as_mainfile(filepath='A_new_world_without_the_cube.blend')
# This returns an error
# "ERROR (bke.bpath): /home/sources/buildbot-x86_64-slave/linux_glibc217_x86_64_cmake/blender.git/source/blender/blenkernel/intern/bpath.c:233 BKE_bpath_relative_convert: basedir='', this is a bug"
# although it can successfully generates a file and finishes.
%%writefile this_cell.txt
でそのセルの内容をそのまま出力。コードをターミナルで直接動かしたいときに使える。
%matplotlib inline
#%matplotlib notebook
from IPython.display import display, HTML
display(HTML("<style>.container { width:80% !important; }</style>"))
import matplotlib.pyplot as plt