mirror of
https://github.com/wassname/blender_ipython.git
synced 2026-09-06 16:30:26 +08:00
initial commit
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
.*
|
||||
*~
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import distutils.spawn
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
blender = distutils.spawn.find_executable("blender")
|
||||
tempscript = tempfile.mktemp()+"_blender_ipython.py"
|
||||
|
||||
with open(tempscript,"w") as f:
|
||||
f.write("""\
|
||||
import sys
|
||||
sys.argv[:] = [sys.executable]
|
||||
from IPython.zmq.ipkernel import IPKernelApp
|
||||
|
||||
app = IPKernelApp.instance()
|
||||
app.initialize(%r)
|
||||
app.start()
|
||||
""" % sys.argv[1:])
|
||||
|
||||
try:
|
||||
print("starting:", blender, '-b', '-P', tempscript)
|
||||
sys.exit(subprocess.call([blender, '-b', '-P', tempscript]))
|
||||
finally:
|
||||
os.remove(tempscript)
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
from os.path import abspath, dirname, join as pathjoin
|
||||
from IPython.frontend.html.notebook.notebookapp import launch_new_instance
|
||||
|
||||
sys.executable = pathjoin(dirname(abspath(__file__)), 'blender_ipython_kernel.py')
|
||||
|
||||
launch_new_instance()
|
||||
Reference in New Issue
Block a user