Search found 894 matches

by CoDEmanX
Wed Oct 02, 2013 8:28 am
Forum: Python
Topic: Check if a poly is a face
Replies: 29
Views: 13809

Hm dunno if there's a faster builtin way (other than using select loose operator), but should work: import bpy, bmesh for ob in bpy.context.scene.objects: if ob.type != 'MESH': continue bm = bmesh.new() bm.from_object(ob, bpy.context.scene) if len(bm.faces) > 0 and 0 not in (len(e.link_faces) for e ...
by CoDEmanX
Wed Oct 02, 2013 1:46 am
Forum: Python
Topic: Check if a poly is a face
Replies: 29
Views: 13809

hm maybe you actually mean to analyse these two cases?

Image

For the left cube, test should return True, for the right (no faces) False?

Code: Select all

[print(ob.name, len(ob.data.polygons) > 0) for ob in bpy.context.scene.objects]
by CoDEmanX
Wed Oct 02, 2013 1:35 am
Forum: Python
Topic: Efficient way of adding large meshes through the Python API
Replies: 6
Views: 7161

Here's a cube mesh added with low level api, should have better performance than the operator: import bpy from bpy_extras.io_utils import unpack_list, unpack_face_list coords = ( (-1.0, -1.0, -1.0), (-1.0, 1.0, -1.0), (1.0, 1.0, -1.0), (1.0, -1.0, -1.0), (-1.0, -1.0, 1.0), (-1.0, 1.0, 1.0), (1.0, 1....
by CoDEmanX
Tue Oct 01, 2013 10:33 am
Forum: Python
Topic: Check if a poly is a face
Replies: 29
Views: 13809

verts and edges are NOT faces, polygons are (triangles, quads and ngons).

Face access goes via .polygons


See my addon, it counts tris, quads and ngons separately:

https://svn.blender.org/svnroot/bf-exte ... _select.py
by CoDEmanX
Tue Oct 01, 2013 12:05 am
Forum: Python
Topic: Check if a poly is a face
Replies: 29
Views: 13809

really dunno what you mean, a polygon is a face and vice versa. What's your definition of face? A triangle? A quad? Both of them, so everything which isn't an Ngon?
by CoDEmanX
Sun Sep 29, 2013 6:07 pm
Forum: Interface & Tools
Topic: Metric (or measuring) system failed.
Replies: 5
Views: 1783

well, if you append/link an object from another .blend, it won't look at the scene settings (=metrics). It's arguable if it should respect the metric settings of another .blend.

I suggest you never change the scene scale, but scale down your 1 cm cube to 0.01 units (1 unit = 1 m = 100 cm)
by CoDEmanX
Sun Sep 29, 2013 2:42 am
Forum: Interface & Tools
Topic: Metric (or measuring) system failed.
Replies: 5
Views: 1783

you might need to apply transformation > scale before saving your first cube
by CoDEmanX
Fri Sep 27, 2013 11:34 pm
Forum: Animation
Topic: Subtract faces
Replies: 1
Views: 5681

you could try the knife project tool
by CoDEmanX
Fri Sep 27, 2013 2:12 am
Forum: Python
Topic: save jpg image as tiff in addon not working
Replies: 4
Views: 6316

does that actually work? I tried it, and it created the file with desired extension, but the content wasn't in the right format. save_render() doesn't render btw., it means it uses some of the scene render settings to store the output! If you set the render settings to TIFF, you can save an image as...
by CoDEmanX
Thu Sep 26, 2013 4:46 pm
Forum: Python
Topic: save jpg image as tiff in addon not working
Replies: 4
Views: 6316

hey travnick, sorry for the late reply, but i couldn't remember where i saw your post. I tested this working: import bpy img = bpy.data.images[0] filepath = r"C:\tmp\_exported_image.tif" def find_color_mode(image): if not isinstance(image, bpy.types.Image): raise(TypeError) else: if image.depth <= 8...
by CoDEmanX
Tue Sep 24, 2013 1:15 pm
Forum: Interface & Tools
Topic: File type to use for games?
Replies: 1
Views: 498

I would go with COLLADA for several reasons:
- it supports armatures
- has native blender support (IO coded in C/C++)
- is an open standard

You could also try FBX, specs are available on the net. It's often used for content IO, but available libraries may not be open source.
by CoDEmanX
Sun Sep 22, 2013 7:36 pm
Forum: Interface & Tools
Topic: Adding vertices in model
Replies: 2
Views: 677

maybe subdivide the face area and use a displacement modifier to get more details into it?

Or edge split individually and give it more detail manually.
by CoDEmanX
Tue Sep 17, 2013 12:15 am
Forum: Interface & Tools
Topic: User unterface and usability
Replies: 18
Views: 4125

for got to say:
you can select an interaction preset in the splash screen (Blender, Maya, 3ds Max)
by CoDEmanX
Tue Sep 17, 2013 12:09 am
Forum: Interface & Tools
Topic: User unterface and usability
Replies: 18
Views: 4125

You can actually bind hotkeys for toggle manipulators, and for switching which are shown. It's not possbile directly via rightclick however. See http://cgcookie.com/blender/2010/05/17/custom-hot-keys/ http://www.blenderartist.org/forum/showthread.php?291296-Manipulator-Hotkey In user prefs > input, ...