Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
archibate committed Nov 22, 2020
1 parent 31c4fd5 commit 0011459
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ win) PIPPLAT=win_amd64;;
osx) PIPPLAT=macosx_10_14_x86_64;;
esac

rm -rf build
mkdir -p build
rm -rf build/Taichi-Blend
cp -r src build/Taichi-Blend
mkdir -p build/Taichi-Blend/bundle-packages
pip install --python-version $PYVERSION --platform $PIPPLAT --no-deps -r requirements.txt -t build/Taichi-Blend/bundle-packages
Expand Down
18 changes: 18 additions & 0 deletions misc/imseqshow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import taichi as ti
import os

images = []
frames = 0
while True:
file = f'{frames + 1:04d}.png'
if not os.path.exists(file):
break
print('Loading', file)
images.append(ti.imread(file))
frames += 1

res = images[0].shape[:2]
gui = ti.GUI('imseqshow', res)
while gui.running:
gui.set_image(images[gui.frame % frames])
gui.show()
File renamed without changes.
File renamed without changes.
19 changes: 2 additions & 17 deletions src/node_system/nodes/blendina.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,32 +105,17 @@ def __init__(self, object, update, verts):

# Make the stupid `StructRNA` happy:
old_name = self.object.name
object = bpy.data.objects[old_name]
old_mesh = object.data.name
new_mesh = None

@bpy.app.handlers.persistent
def save_pre(self):
print('save_pre', old_mesh)
try:
nonlocal new_mesh
print('save_pre', old_name)
object = bpy.data.objects[old_name]
new_mesh = object.data.name
object.data = bpy.data.meshes[old_mesh]
object.data = bpy.data.meshes[old_name]
except Exception as e:
print('save_pre', repr(e))

@bpy.app.handlers.persistent
def save_post(self):
print('save_post', new_mesh)
try:
object = bpy.data.objects[old_name]
object.data = bpy.data.meshes[new_mesh]
except Exception as e:
print('save_post', repr(e))

bpy.app.handlers.save_pre.append(save_pre)
bpy.app.handlers.save_post.append(save_post)

def update_data(self):
self.update.run()
Expand Down

0 comments on commit 0011459

Please sign in to comment.