Archive

Monthly Archives: September 2014

Shapeways is changing the way they price Strong & Flexible plastics and Steel. According to them, it’s on average 20% to 30% cheaper than before.

I’m interested in how this will affect models with interlocking parts, as the price will now factor in number of parts.

Anyhoo, check out the news!

Advertisements

selection in Blender

I’d wanted to select a certain mesh object and then edit it, but was getting weird errors, like:

RuntimeError: Operator bpy.ops.mesh.select_all.poll() failed, context is incorrect

and

RuntimeError: Operator bpy.ops.object.mode_set(mode='EDIT').poll() failed, context is incorrect

I couldn’t find my actual initial code, so here’s me trying to replicate it. All I’m doing is selecting the first cube.

my_object = bpy.context.scene.objects['Cube']
my_object.select = True
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')

>>> RuntimeError: Operator bpy.ops.mesh.select_all.poll() failed, context is incorrect

Turns out I needed to set the object as the active object and deselect any other object. If the originally selected object was in EDIT mode, I needed to toggle to OBJECT mode before toggling back EDIT mode. Otherwise, bpy.ops.object.mode_set(mode='EDIT') will appear finished but actually fail.

other_object = bpy.context.scene.objects['Cube.002']
other_object.select = False

my_object = bpy.context.scene.objects['Cube']
my_object.select = True
bpy.context.scene.objects.active = my_object

bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.mode_set(mode='EDIT')

bpy.ops.mesh.select_all(action='SELECT')
success

Success!

Hope this helps!

*My example snippet can replicate the select_all error, if the original object was in EDIT mode, but I can’t seem to reproduce the edit_mode error. However, I haven’t had any problems after deselecting all other objects and toggling to OBJECT mode before any further operations.

Blender 2.72

It’s been a while since I’ve been this excited about 3D printing news!

Formlabs just posted a blog post yesterday about how they 3D printed a lens for a monocle.

Formlabs Monocle

Monocle frame and lens printed on Form 1+ 3D Printer. Photo by Formlabs.

I’m really curious about its optical resolution. We might be really close to being able to print lenses for glasses!

Time to get back on my 3D Print Your Own Glasses project.