Search found 46 matches

by dvochin
Wed Aug 21, 2013 8:49 am
Forum: Python
Topic: How to read the final blended position of shape keys...
Replies: 3
Views: 676

Hi CoDEmanX, I though I tried with bmesh but wasn't getting the mix. Will try thoroughly tomorrow with your 2 code segments and report what I find.

Many thanks! :)
by dvochin
Mon Aug 19, 2013 3:04 am
Forum: Python
Topic: How to read the final blended position of shape keys...
Replies: 3
Views: 676

Ha! finally found it! Add a new shape key 'from mix', and the 'baked' verts position are in its array! aKeys = oMeshO.data.shape_keys.key_blocks bpy.ops.object.shape_key_add(from_mix=True) ###LEARN: How to 'bake' the current shape key mix into one. nKeys = len(aKeys) aVertsBakedKeys = aKeys[nKeys-1]...
by dvochin
Mon Aug 19, 2013 1:16 am
Forum: Python
Topic: How to read the final blended position of shape keys...
Replies: 3
Views: 676

How to read the final blended position of shape keys...

Hello! I have a mesh that has several modified shape keys applied and each of these shape keys is blended (to protect mesh borders)... I need to access from Blender python the fully-blended position of my mesh as it is displayed in object mode with the current settings of all shape keys sliders at t...
by dvochin
Wed Jul 31, 2013 6:22 pm
Forum: Python
Topic: How to efficiently find verts by 3D position...
Replies: 4
Views: 991

Ah very cool! closest_point_on_mesh() is then probably fast enough for me although if that student could just strip the extra work of finding the related face and the closest point on that face it would be even more useful. I need to search verts by coordinates because the boolean modifier I use hea...
by dvochin
Tue Jul 30, 2013 6:45 pm
Forum: Python
Topic: How to efficiently find verts by 3D position...
Replies: 4
Views: 991

Hi CoDEmanX, thanks for that response. BVH would indeed be awesome for this and offer best overall performance... I'm just surprised given the sophistication of the Blender API that vert-search by position is not already a uber-optimized service used by tons of higher-up Blender functionality (like ...
by dvochin
Mon Jul 29, 2013 12:40 am
Forum: Python
Topic: How to efficiently find verts by 3D position...
Replies: 4
Views: 991

How to efficiently find verts by 3D position...

Hi, is there a way from blender python to quickly find the vert at a given position (without forcing python to iterate through all verts)? Alternatively, C-based code that would return the closest vert would be good too. So far the closest call is closest_point_on_mesh() but that gives me the closes...
by dvochin
Mon Jul 29, 2013 12:33 am
Forum: Python
Topic: How to force View3D update in the middle of Python script...
Replies: 6
Views: 4717

Very well, thanks for the tip, will try!
by dvochin
Thu Jul 25, 2013 2:20 am
Forum: Python
Topic: How to force View3D update in the middle of Python script...
Replies: 6
Views: 4717

Hi Codemanx, thanks for taking the time... your continued help in this forum is priceless! I tried bpy.ops.scene.update() many times and it doesn't work. I just tried bpy.context.area.tag_redraw() just now and it also doesn't do it! So far the only thing I found that works is bpy.ops.wm.redraw_timer...
by dvochin
Wed Jul 24, 2013 10:47 pm
Forum: Python
Topic: How to force View3D update in the middle of Python script...
Replies: 6
Views: 4717

Found it! If this helps someone just insert a "bpy.ops.wm.redraw_timer(type='DRAW', iterations=1)" in the middle of your code and further statements will be able to act upon the updated scene. I can now have knife_project() being purely programmatic and being correctly oriented to whatever position ...
by dvochin
Wed Jul 24, 2013 9:17 pm
Forum: Python
Topic: How to force View3D update in the middle of Python script...
Replies: 6
Views: 4717

P.S. I've tried setting "Smooth View" to zero in User Preferences / Interface to enable immediate camera changes but the same thing happens.
by dvochin
Wed Jul 24, 2013 9:15 pm
Forum: Python
Topic: How to force View3D update in the middle of Python script...
Replies: 6
Views: 4717

How to force View3D update in the middle of Python script...

Hi all, I need to create a python script that will select some objects, rotate the view to a set position and perform a bpy.ops.mesh.knife_project() from the my updated view position. The script works perfectly but unfortunately my call to knife_project() does the cutting from whatever position the ...
by dvochin
Wed Jul 24, 2013 2:34 am
Forum: Python
Topic: How to call from python function that require View3D context
Replies: 4
Views: 2215

Note that additional info & discussion on this issue can be found at http://www.blender.org/forum/viewtopic. ... 787#105787
by dvochin
Wed Jul 24, 2013 2:33 am
Forum: Python
Topic: How to programmatically call bpy.ops.xyz operators in Python
Replies: 7
Views: 3415

Yup... agreed there... had I not been tracing through blender's code for bpy.ops.mesh.knife_project() and its complex contexts checks it would have taken longer! But you're right, the very helpful 'PyContext: 'xyz' not found log at least told me what was missing and it was a breeze to fix. I recomme...
by dvochin
Wed Jul 24, 2013 2:00 am
Forum: Python
Topic: How to pass custom context to complex operator?
Replies: 7
Views: 4175

For those who need to call bpy.ops operator from VIEW_3D context I created a solution at http://www.blender.org/forum/viewtopic. ... 783#105783 :)
by dvochin
Wed Jul 24, 2013 1:59 am
Forum: Python
Topic: How to programmatically call bpy.ops.xyz operators in Python
Replies: 7
Views: 3415

For those following this I found a solution and I posted it at http://www.blender.org/forum/viewtopic. ... 783#105783

:)