Commit Graph

30581 Commits

Author SHA1 Message Date
Campbell Barton
400a0297b0 - simplify rip code not to expand/contract selection.
- disable BVH edge visibility test (ifdef'd out. dont think its really needed)
2012-03-07 00:08:00 +00:00
Sergey Sharybin
7c59666a27 Mango request: for range buttons copy start+1 to end if start>=0
Also copy end-1 to start if changing end boundary and end<=start.

Scene's start/end frames and ghost range in armature buttons are affected.
2012-03-06 21:42:03 +00:00
Nicholas Bishop
2fd7a56526 Fix textured-mode drawing in editmode.
It's currently not respecting the material color, probably since the
BMesh merge. There are a couple problems, both involving "dummy"
variables taking the place of actual MTFace/MCol data.

Code review: http://codereview.appspot.com/5753050/
2012-03-06 21:21:22 +00:00
Campbell Barton
ef67172587 bmesh edge split - use a faster method of finding isolated split edges. 2012-03-06 20:41:11 +00:00
Juha Mäki-Kanto
1148344f46 fix #30440, Collada import: no faces/uv after bmesh merge
Seems too simple, just missing call to convert_mfaces_to_mpolys.
2012-03-06 19:50:07 +00:00
Campbell Barton
d1937de1d2 fix for own error in edge-rotate keeping edge customdata - this was crashing when rotating multiple edges.
Now create the rotate edge in advance and copy its customdata (before joining the faces).

This commit also fixes an annoyance where tryangulating faces could create duplicate edges.
2012-03-06 19:29:05 +00:00
Campbell Barton
31d2ee9bf7 style cleanup, brackets in else/if, some indentation. 2012-03-06 18:40:15 +00:00
Campbell Barton
7b7214c722 code cleanup - give edge split more helpful var names and replace edgetag macros with static functions. 2012-03-06 17:23:26 +00:00
Sergey Sharybin
bffeab99ae Fix for fracture object crash
Issue was caused by incorrect resetting of tesselated fave data in copy_mesh:
- CustomData_free will free data from original mesh because layers in new mesh
  are pointing to the same memory just after copy. So it's needed only to
  set some pointers to NULL.
- It was incorrect filling fdata with zeroes because of incorrect structure size used.
2012-03-06 16:22:41 +00:00
Campbell Barton
5ba020da4f bmesh: speedup for deselecting all, (avoid topology loops since all get deselected anyway).
& some ascii art to explain BM_face_other_vert_loop() behavior.
2012-03-06 16:17:55 +00:00
Brecht Van Lommel
0deeab95be Fix sculpt partial redraw in viewport not working, my mistake, found by Nicholas. 2012-03-06 14:48:11 +00:00
Sergey Sharybin
7edb514945 Actual fix for mango files crashes on load
Was caused by recent code cleanup.
2012-03-06 14:46:45 +00:00
Sergey Sharybin
c6f7c97daa Fix for crash when loading some mango files
Seems that issue is caused by several threads accessing to movie clip and one
of the threads (compositor node) was editing ImBuf which isn't nice anyway.
2012-03-06 13:57:28 +00:00
Campbell Barton
3882f7cde7 quiet some warnings and fix build error with strict casting rules. 2012-03-06 12:51:17 +00:00
Sergey Sharybin
91c2aa7b95 Camera tracking: wall scene orientation operator
Made Set Floor a bit more general and name it Set Plane which defines
orientation from 3 selected tracks and makes them belong to specified
plane (wall or floor).
2012-03-06 12:27:42 +00:00
Howard Trickey
bb21641e1c Fix to knifetool when intermediate point in space.
Before, if you cut the same edge multiple times
with an intermediate point in space, it wouldn't
get all of the edges.
2012-03-06 12:16:55 +00:00
Howard Trickey
d87f08cbaa Add BM_face_split_n which splits a face with intermediate points with given coordinates.
This will be used in soon-to-be-commited knife tool rewrite.
Interpolates using the original face.
Also fixed or improved a couple of comments.
2012-03-06 12:09:35 +00:00
Lukas Toenne
92322b57d4 Fix for 30439, Cycles node group conversion wasn't checking node->id pointer (group node without internal node tree). This is a somewhat unusual case (UI buttons don't allow unlinking group tree), but not entirely forbidden.
Also fixed similar issue in node_templates.c where the group tree is used to generate a button name.
2012-03-06 11:34:57 +00:00
Sergey Sharybin
2b9551a4e4 Fixed typo in tracking-related tweaks for depsgraph resulting with crash
in special cases (like setting camera's constraint clip if scene's clip is not set)
2012-03-06 11:24:23 +00:00
Nicholas Bishop
cc850522bc Fix incorrect null parameter in PBVH drawing 2012-03-06 09:19:13 +00:00
Nicholas Bishop
919a0d99fb Code cleanup: remove some PBVH material code that isn't needed anymore. 2012-03-06 03:34:27 +00:00
Nicholas Bishop
c7ffe7f621 Draw individual face's material and shading correctly in the PBVH.
Previously, the shading and material was set once per PBVHNode when
drawing. This is still the case, but PBVHNodes are now built to
contain only one material and shading mode.

This is done with an extra partitioning step; once the number of
primitives in the node falls below the PBVH leaf limit, it's
primitives are checked for matching materials. If more than one
material or shading mode is present in the node, it is split and
partitioned (partitioned by material rather than 3D location.)

Given a sufficiently 'annoying' input, like a dense mesh with
thousands of materials randomly scattered across it, this could
greatly increase PBVH build time (since nodes might end up containing
a single primitive), but in general this shouldn't come up.

In order to support materials for grids, the CCGDM is building another
grid array (of DMFaceMat structs). This could be used to replace
CCGDM.faceFlag for some small memory savings (TODO).
2012-03-06 02:40:08 +00:00
Nicholas Bishop
9c7e8e837d Code cleanup: remove unused parameter from some ccgSubSurf accessors.
Remove 'CCGSubSurf *ss' parameter from ccgSubSurf_getFaceFaceHandle,
ccgSubSurf_getFaceVert, and ccgSubSurf_getFaceEdge.
2012-03-06 01:01:42 +00:00
Nicholas Bishop
c729d6a87b Bugfix and code cleanup: use better types for faceFlags in CCGDM.
Previously this was just a character array that stored face/poly flags
and mat_nr. Since mat_nr should be a short, this would have truncated
for higher values.

Replaced with a new DMFaceFlags struct.
2012-03-06 00:17:03 +00:00
Bastien Montagne
0114d78c33 Code cleanup in rna files (huge, higly automated with py script).
Addresses:
* C++ comments.
* Spaces after if/for/while/switch statements.
* Spaces around assignment operators.
2012-03-05 23:30:41 +00:00
Nicholas Bishop
1eb893a114 Code cleanup: factor out some common code from PBVH build_sub/build_leaf. 2012-03-05 22:24:49 +00:00
Nicholas Bishop
190c233293 Code cleanup: add comments for build_sub() and remove debug function.
Remove the function (and call to) check_partitioning(), this was just
a debug function.
2012-03-05 22:12:50 +00:00
Nicholas Bishop
10d1079226 Code cleanup: split PBVH build_sub() into two functions.
Removes also a confusing else{} block that didn't make much sense.
2012-03-05 21:55:53 +00:00
Sergey Sharybin
3f04564724 Disable interpolation of customdata layers on edge slide
This option might be useful in some cases like keeping UV coordinated in kind of
"correct" state so sliding edge loop will also slide edges in UV. But for other
layers like shapekeys and vertex colors it's arguable it's actually needed.

The way it's currently done isn't actually acceptable because it doesn't take
flags like UVCALC_TRANSFORM_CORRECT into account and also makes extra unwanted
things like interpolating shapekeys which leads to propagating changes into
basis keys and also results with slide applied twice for relative keys because
offset is also applying on loading edit mesh.

Also discussed with Brecht who agreed with marking this things as TODO and
disabling for now.

This should fix issue reported in #30387: Edge Slide propogates to Basis Shape Key
2012-03-05 21:42:17 +00:00
Nicholas Bishop
e2003f9a6c Code cleanup: remove unused drawFacesColored from DerivedMesh.
This function pointer isn't called anymore, so removing it and the
cddm/ccgdm/gpu code associated with it.
2012-03-05 21:27:28 +00:00
Campbell Barton
bd83487dab fix [#30459] BMesh Edge Split Hangs.
edge split result is still not correct in this case but at least avoid eternal loop.

also - dont tag sharp edges with <2 faces for splitting.
2012-03-05 21:17:24 +00:00
Sergey Sharybin
1ae27144f6 Fix for OpenEXR half float save function resulting in dark images saved
Float buffers of ImBuf are always supposed to be linear space a,d ImBuf's
profile means how byte array was constructed from float buffer.
2012-03-05 18:54:57 +00:00
Campbell Barton
a5eadf14e0 copying a mesh was generating tessfaces which isnt needed 2012-03-05 18:05:06 +00:00
Sergey Sharybin
03ebd2091b Add stub needed for blenderplayer compilation. 2012-03-05 17:23:52 +00:00
Campbell Barton
529b2a01eb added check for DNA C syntax we cant parse:
void*somepointer;

.. this is valid C but breaks makesdna.c
2012-03-05 16:21:13 +00:00
Bastien Montagne
1e41b19ec1 tesselat -> tessellat in UI messages, + style edits. 2012-03-05 16:19:16 +00:00
Sergey Sharybin
aa0eb72c18 Fix for missed faces in mesh after switching active shape key in edit mode. 2012-03-05 14:25:52 +00:00
Campbell Barton
4f447921d2 RegionView3D.update call, to address issue in report:
[#30454] perspective_matrix not update in real time with bpy.ops.view3d.zoom

This is so you can modifify the view settings and get the view matrix after without waiting for a redraw.
2012-03-05 13:02:45 +00:00
Campbell Barton
f6ddb79e20 fix [#30457] Smooth normals wrongly exported to wavefront
mesh.calc_normals() wasnt calculating vertex normals (only face normals),

now only calculate vertex normals.

added a define incase we want to have poly normals back again.
2012-03-05 11:49:24 +00:00
Campbell Barton
4b940364a1 edge rotate now keeps edge properties (like seam, crease, bevel weight.. etc) 2012-03-05 01:53:30 +00:00
Campbell Barton
4d84e869a0 Improvements to bmesh edge rotate
On a user level, edge rotate now works better with multiple edges selected, it wont make zero area faces or rotate edges into existing ones.

With a single edge selected - rotate is less strict and will allow ugly resulting faces but still checks on duplicate edges.

API:
* BM_edge_rotate now takes a flag, to optionally...
** check for existing edge
** splice edge (rotate and merge)
** check for degenerate resulting faces (overlapping geometry, zero area)
** beauty - only rotate to a better fit.
... this allows it to still be used as a low level API function since all checks can be skipped.

* BM_edge_rotate() now works a bit different, it find the new edge rotation before joining the faces - exposed by BM_edge_rotate_calc().

* Added api call bmesh_radial_faceloop_find_vert() - Radial Find a Vertex Loop in Face
2012-03-05 00:50:18 +00:00
Sergey Sharybin
5f509134ec Added option to fit frame to the whole clip editor viewport instead of zooming
to a power-of-two factor. Shortcut is F.
2012-03-04 21:02:58 +00:00
Sergey Sharybin
c395c862e9 Track cleanup operators are now moved to the global clip editor shortcuts
which makes it possible to cleanup tracks from curve view.
2012-03-04 20:44:09 +00:00
Sergey Sharybin
0963f45c66 Fixed copyright lines for some tracking related DNA files. 2012-03-04 20:23:50 +00:00
Sergey Sharybin
f79232cf34 Movie clip editor: implemented border select operator for curves view 2012-03-04 19:34:01 +00:00
Campbell Barton
a0ab2eefb9 * rename BM_face_other_loop --> BM_face_other_edge_loop
* optimize BM_face_other_edge_loop to do about half as many iterations for quad heavy meshes, with ngons the gain is much more since searching around the entire ngon when the edge already stores its loop is silly.
 ... also nicer in cases where edge has no face users it avoids a loop on all face corners.
2012-03-04 16:36:31 +00:00
Campbell Barton
76e9f91d1c switch arg order for BM_face_other_* funcs (make face come first), and add nice ascii art for BM_face_other_vert_loop since this stuff is hard to grasp as text. 2012-03-04 16:01:02 +00:00
Arystanbek Dyussenov
c2760307e8 #collada skeleton import, bugfix #29621
Do not crash when joint SIDs cannot be resolved.

OpenCOLLADA cannot resolve joint SIDs connected to skin if the <skeleton> tag is missing.

Page 148 of COLLADA spec 1.4.1 states: "<skeleton> elements define where to start the sid lookup". So I think this is a bug in "FBX COLLADA exporter" which did not add the <skeleton> tag.

The problem can be fixed by manually adding the <skeleton> tag into <instance_controller>.
2012-03-04 13:43:23 +00:00
Campbell Barton
12d0489b33 fix for building openjpeg image support on OpenSUSE 12.1, also quiet compile warning. 2012-03-04 11:58:55 +00:00
Campbell Barton
34db81a6dc fix for missing NULL check in bmesh.from_mesh(), bug [#30446] 2012-03-04 11:10:11 +00:00
Lukas Toenne
dceab32f78 Small feature for the viewer linking operator: When no viewer node is present in the tree, it automatically adds a new one next to the output socket.
Also changed the poll function of that operator to make sure it actually only works on compositor trees (others don't have viewer nodes).
2012-03-04 10:49:13 +00:00
Campbell Barton
f6ae27daef style cleanup - comment spelling + translate some dutch. 2012-03-04 04:35:12 +00:00
Campbell Barton
4f2976941f fix for issue raise by patch [#30154] non utf8 buildinfo, fails to import 'bpy' module.
we cant ensure buildinfo to have utf8 encoding so access it as bytes via python - a different workaround then this patch made.

also use C style string formatting for sys_info.py
2012-03-04 03:14:38 +00:00
Joshua Leung
6c37e0a442 Whitespace tweaks 2012-03-04 02:43:15 +00:00
Campbell Barton
d99888d786 bmesh: add back feature from 2.4x Ctrl+Shift+T subdivides quads in the alternate direction. 2012-03-04 02:18:17 +00:00
Campbell Barton
88e0bcfbe1 fix for crash in bmesh py api, was missing NULL checks for parsing sequences and had bad string formatting in exception. 2012-03-04 02:09:02 +00:00
Campbell Barton
e583aa8e34 changes to ED_mesh_update() to work with OBJ import.
* calculate vertex normals (previously was calculating face normals only)
* clear tessfaces unless theres an argument to build them. since no tessfaces is the default state right now.
* if convert_mfaces_to_mpolys() runs, dont calculate edges, since it already does that.
2012-03-04 00:16:50 +00:00
Campbell Barton
8c7ea2f746 #ifdef out ngon edge-ring loop support, from r44561, this is a nice feature but can too easily give bad results, perhaps being it back with some sanity checks. 2012-03-03 22:27:34 +00:00
Campbell Barton
1531e3677a bmesh py api
* add BLI_rfindlink for reverse index lookup (used so bm.select_history[-1] doesn't have to loop the entire list twice).
* add bm.select_history.active so you can get the last selected item or None without having to check seq length.
2012-03-03 22:07:58 +00:00
Bastien Montagne
685fda4f13 Many i18n fixings, based on [#30428] [2.62] Translation Issues.
In fact, most "UI special cases" are not well translated, currently. :/ This affects especially the "Properties" panels. This commit should address problems in Graph editors, and 3D View (but probably not yet all of them). Yet it already adds more than 100 new messages (and fixes translated drawing of more).

Also done some style edits…
2012-03-03 21:42:21 +00:00
Campbell Barton
3590076193 style cleanup - comment formatting 2012-03-03 20:36:09 +00:00
Campbell Barton
95670e03a0 style cleanup / comment formatting for bli/bke/bmesh 2012-03-03 20:19:11 +00:00
Campbell Barton
a2c182e923 style cleanup - use aligned * prefixed blocks for descriptive comments (was already used a lot and part of proposed style guide). 2012-03-03 16:31:46 +00:00
Campbell Barton
86cec98f9e fix for leak in bmesh edge split - assert when invalid args are given rather then returning NULL. 2012-03-03 14:48:50 +00:00
Campbell Barton
cbc07986b5 bmesh support for rotating multiple edges at once. 2012-03-03 12:49:03 +00:00
Campbell Barton
9c18ade898 bmesh edge rotate
* improve check to see if edge rotate can be done,
  was checking if both edges verts have an edge count of 2, which is really a meaningless test since the verts can have stray edges connected and the result wont work right.
  instead check if the next verts in both faces share a vertex.

* add utility function BM_face_other_vert_loop() which gets the next loop in a face.
* add convenience function BM_edge_face_pair() which returns 2 faces for edges that have exactly 2 face users. (saves ugly e->l->radial_next ... in code) and is more readable.
2012-03-03 12:35:37 +00:00
Campbell Barton
9d49fa0e63 style cleanup - spelling corrections & update some incorrect comments. 2012-03-03 11:45:08 +00:00
Dalai Felinto
1f928833f3 option for the Armature Actuator to change the influence of a bone constraint.
Also adds DampedTrackTo to the list of supported constraints in the BGE

Test file:
http://www.pasteall.org/blend/11715

Patch developed as part of a project to NF-UBC Nereus Program.
Development time 'sponsored' by the project.
www.nereusprogram.org
2012-03-03 02:47:01 +00:00
Campbell Barton
95bba22af0 fix for error report in property registration, it wasnt printing the error. 2012-03-03 00:20:05 +00:00
Bastien Montagne
b3a0a33791 "Fix" [#30431] UI string spelling & similar fixes.
All suggested changes looked good to me, thx to Michael Färber for this list of changes!
2012-03-02 21:14:37 +00:00
Campbell Barton
e9c935caa0 fix bug [#30426] crash in bmesh python api.
if blender freed the BMesh before python was finished (on exit editmode for eg), python would attempt to access the bmesh to clear python pointers in it.
2012-03-02 18:23:08 +00:00
Campbell Barton
cc8e2d12a7 remove prints committed by accident. 2012-03-02 17:53:39 +00:00
Campbell Barton
7bbf4b7831 style cleanup
- spelling - turns out we had tessellation spelt wrong all over.
- use \directive for doxy (not @directive)
- remove BLI_sparsemap.h - was from bmesh merge IIRC but entire file commented and not used.
2012-03-02 16:05:54 +00:00
Campbell Barton
63f5b96fe3 mesh.update() now has option to calculate tessellation faces. 2012-03-02 14:46:14 +00:00
Campbell Barton
21280a6386 Code Cleanup - naming consistancy for bmesh struct types 2012-03-02 12:44:34 +00:00
Campbell Barton
622ac0dd16 code cleanup:
replace casts: '((Mesh *)ob->data)->edit_btmesh' with 'BMEdit_FromObject(ob)'

also minor style edits.
2012-03-02 12:09:49 +00:00
Campbell Barton
cf927d3fd1 bmesh minor changes
* dont check selection and hiddent state (select + hide isnt allowed and api ensures this)
* MESH_OT_noise had incorrect check for texture (checked if slot [0] was filled but then used active texture)
2012-03-02 10:49:15 +00:00
Bastien Montagne
47a1c7e5aa Fix [#30419] Median wrongly setting lattice vertex weights.
In fact, the same bug affected curves' weights too. Now using the same method as for setting mesh edges' crease and bevel weights. Also factorized/simplified that part of code by defining a new utility func computing the scale factor.

Also greatly simplified UI code in same v3d_editvertex_buts() function, was really over-complicated (this fixes btw a few minor UI bugs in the transform editmode panel, like missing tips, etc.).
2012-03-02 10:30:11 +00:00
Campbell Barton
979a80e743 minor edits to last commit - use fixed chunksize, rather than the number of verts/edges/faces in bm_mempool_init(). 2012-03-01 23:59:34 +00:00
Campbell Barton
c26f5035b6 style cleanup for mempool 2012-03-01 23:14:51 +00:00
Campbell Barton
bc767059cb Code Cleanup: update to mempool, use flag rather then bool args. 2012-03-01 22:59:18 +00:00
Campbell Barton
921a7556fb bmesh - changes to mempool allocations
* double default edge allocation size (double the number of verts/faces).
* CustomData_bmesh_init_pool was using allocsize & chunksize as the same variable. Now use type specific chunk size.
* bmesh copy and editmode conversion now allocate the BMesh mempool size needed for the entire vert/edge/loop/face arrays since its known already.
2012-03-01 22:17:04 +00:00
Brecht Van Lommel
2942eab57c Fix #30413: dynamic paint crash with texture slots with no texture assigned. 2012-03-01 20:41:13 +00:00
Campbell Barton
9aafe32147 bmmesh api - use struct rather than int[4] to initialize mesh sizes.
also correct bad assert() in previous commit.
2012-03-01 20:09:17 +00:00
Brecht Van Lommel
d534f0e16d Fix #30405: combine HSVA node not working correct with fixed color instead
of socket connected as input, patch by Denis Declara.
2012-03-01 20:05:14 +00:00
Brecht Van Lommel
8643b8a02d Fix related to #30416: python render_stats handler now also gets called when the
saved file message is printed.
2012-03-01 19:19:10 +00:00
Brecht Van Lommel
dff2e84427 Fix #30415: motion blur option still had an effect on external engines / cycles,
should not be used then.
2012-03-01 19:19:04 +00:00
Campbell Barton
e69a758eaa fix [#30280] bmesh: Dissolve with error message kills Crease
CD_MASK_BMESH was didnt include crease of bevel weight - so copying the bmesh would skip these.
2012-03-01 19:05:14 +00:00
Campbell Barton
522b73a635 bmesh api:
* name bmesh operator func's BMO_slot_buffer_* rather then BMO_slot_* since it wasnt obvious some only dealt with buffer, some both.
* more typechecks and asserts of BMO_ functions (I lost some time calling a map with a buffer function that failed silently).
* small speedup for extrude check - test if the edge is wire _before_ doign a hash lookup.
2012-03-01 17:38:04 +00:00
Campbell Barton
1f473a78b8 Code Cleanup: remove bmesh_radial_loop_next() function,
just access l->radial_next
2012-03-01 17:13:02 +00:00
Lukas Toenne
c1e8d77842 Same fix for file output node as Brecht did in r44580, EXR compression is defined in exr_codec instead compression. 2012-03-01 17:02:05 +00:00
Campbell Barton
e89f09a774 fast-path for BM_edge_is_manifold, BM_edge_is_boundary functions. 2012-03-01 16:56:42 +00:00
Brecht Van Lommel
93249c35b1 Fix related to #30384: multilayer exr files not saving compressed correctly. 2012-03-01 16:41:51 +00:00
Campbell Barton
3b8d96820f fix [#30399] bmesh: Extrusions adjacent to mirror plane leave stray edges.
thanks to Antony Riakiotakis for finding the cause.
2012-03-01 16:27:44 +00:00
Campbell Barton
64007f5625 bmesh regression with extrude.
Extruding an edge where both verts were clipped would not create a face for this edge.

This is ok when a connected face is also extruded but not when the edge is selected on its own.
2012-03-01 16:12:11 +00:00
Campbell Barton
4a5078d6c9 style cleanup
* add extra argument to BMO_slot_map_to_flag() to filter by vert/edge/face
* made BMO_slot_map_* / BMO_slot_buffer_* functions stricter with type checking.
2012-03-01 16:04:37 +00:00
Campbell Barton
216f74880e style cleanup: bmesh - have continue on new line, also avoid unneeded loop in bmo_extrude_face_region_exec() in some cases. 2012-03-01 13:13:08 +00:00
Campbell Barton
ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +00:00
Lukas Toenne
6a36b6249b Call the node freestorage callback _before_ actually freeing sockets, since this is also responsible for freeing possible socket storage data. 2012-03-01 12:07:59 +00:00
Lukas Toenne
b671f5e0de When adding a file output socket make it active, for convenience. Also move back one index when deleting the last. 2012-03-01 11:41:15 +00:00
Lukas Toenne
171d6bf509 Fix for Multilayer EXR API. This was using implementation stubs directly in the header file, causing problems with scons in particular. 2012-03-01 11:19:41 +00:00
Lukas Toenne
537605f0d4 Fix for wrong channel number in ImBuf when file node output format is something other than RGBA. This doesn't get set in the init function, has to be done manually (i guess?). 2012-03-01 08:47:32 +00:00
Lukas Toenne
77442de6c0 * Removed DNA_DEPRECATED tag from old NodeImageFile struct typedef, it doesn't work that way (duh)
* Moved format field and added (deprecated) sfra and efra ints to ensure some forward compatibility of file output node. Earlier blender versions will simple interpret the struct as NodeFileImage, so by matching the first fields the numbers can stay somewhat valid.
2012-03-01 08:17:16 +00:00
Lukas Toenne
2eb29e4788 A number of improvements for the file output node(s).
1) Old CMP_NODE_OUTPUT_FILE and CMP_NODE_OUTPUT_MULTI_FILE have been merged,
only CMP_NODE_OUTPUT_FILE remains. All functions renamed accordingly.

2) do_versions code for converting single-file output nodes into multi-file
output nodes. If a Z buffer input is used, the node is made into a multilayer
exr with two inputs. (see below). Also re-identifies multi-file output nodes
with the CMP_NODE_OUTPUT_FILE type.

3) "Global" format is stored in node now. By default this overrides any
per-socket settings.

4) Multilayer EXR output implemented. When M.EXR format is selected for node
format, all socket format details are ignored. Socket names are used for layer
names.

5) Input buffer types are used as-is when possible, i.e. stored as B/W, RGB or
RGBA. In regular file output the format dictates the number of actual channels,
so the CompBuf is typechecked to the right type first. For multilayer EXR the
number of channels is more flexible, so an input buffer will store only the
channels it actually uses.

6) The editor socket type is updated from linked sockets as an indicator of the
actual data written to files. This may not be totally accurate for regular file
output though, due to restrictions of format setting.
2012-03-01 07:56:15 +00:00
Sergey Sharybin
1d5a3886a1 Fix crash on edge slide when object has got multires modifier
Issue was caused by fix for slide+automerge bug resulted in accessing to freed memory
from multires projection code. Solved by moving multires projection from cleanup callback
to special_aftertrans_update.

Patch by Antony Riakiotakis with some own corrections.
2012-03-01 07:10:45 +00:00
Nicholas Bishop
4dfc25223f Remove struct NgonInterpModifierData and related ModifierType Info.
This modifier was already removed in r44288, looks like these were
just missed.
2012-03-01 02:20:10 +00:00
Campbell Barton
af0a469307 fix [#29135] NGons dont work with loop cut
patch by Andrew Wiggin
2012-02-29 17:23:41 +00:00
Sergey Sharybin
034b1711ea Changes to startup.blend:
- Pinch/Magnify brush isn't available from vertex paint mode anymore.
- Switch default texture to Low Quality bump method
  The same method is used for new textures and it makes possible to
  view bump in 3D viewport with GLSL shading.
- Anisotropic filtering is set to 2x by default.
2012-02-29 17:01:43 +00:00
Campbell Barton
6c53638863 add an assert for inserting an egde with the same vertices and a BMESH_TODO for bevel. 2012-02-29 16:29:09 +00:00
Campbell Barton
ce64128a84 error in recent header commit. 2012-02-29 15:42:34 +00:00
Howard Trickey
fc84402632 Mistake in previous commit test for API vert new: it failed for no-arg case. 2012-02-29 15:35:10 +00:00
Campbell Barton
29b027294d use floats rather then doubles for bmesh poly functions. 2012-02-29 15:21:09 +00:00
Howard Trickey
87af0e1912 Undid part of commit 44552: can't use mathutils on doubles 2012-02-29 15:10:01 +00:00
Campbell Barton
7cc206ddca Code Cleanup: remove non existing function declarations.
added some missing functions too - which are not used yep but should be there for api completeness.
* CDDM_set_mloop
* CDDM_set_mpoly
* BLI_mempool_count
2012-02-29 15:00:37 +00:00
Sergey Sharybin
0cec655b29 Fix #30328: Crash when using edge slide
Looks like it was missed BMesh element index for faces in emDM_drawMappedFacesMat.
There was already call of BM_mesh_elem_index_ensure to ensure there's element
index for vertices, added flag to ensure there's also index for faces.
2012-02-29 14:32:09 +00:00
Howard Trickey
0d2ba6bff6 Code cleanup, no functional change: use mathutils copy
Also renamed a variable to make intent clearer (else seemed like
there was a bug).
2012-02-29 14:23:31 +00:00
Howard Trickey
d330efa084 Fix 30401: Python API vert new((0,0,0)) crashes.
Thanks to Campbell for fix, adding an & to an arg.
Also needed to negate the sense of a later test.
2012-02-29 14:16:35 +00:00
Brecht Van Lommel
3e159f65f9 UI: change shortcut to clear value in button with mouse over it (for the second
time, sorry), from delete to backspace. Delete did not work on buttons in nodes,
because it would delete the node itself or if we changed the priority interfere
with deleting nodes if the cursor was placed accidentally over a button in a node.

Patch by Damir Prebeg.
2012-02-29 14:10:12 +00:00
Campbell Barton
17ee9f77c5 bmesh py api - initial support for selection history. 2012-02-29 14:05:03 +00:00
Sergey Sharybin
c058ba207f Compilation error fix for recent indicer refactor commit. 2012-02-29 13:17:11 +00:00
Sergey Sharybin
d8bdd4497e Refactor of proxies build operators
Split proxy build operator into three parts:
- Prepare context (IMB_anim_index_rebuild_context) which prepares all
  needed data and stores it in an anonymous structure used by specific
  builder lately.
- Build proxies/timecodes into temporary files (IMB_anim_index_rebuild)
  This function will build all selected proxies/timecodes into a temporary
  files so old proxies will be still available during building.
- Finish building proxies (IMB_anim_index_rebuild_finish) which copies
  temporary files over old proxies filed and releases all resources used
  by a context.

Context creation and finishing building happens in a main thread so
it's easy and safe to close all opened handles of proxies files and
refresh cache after rebuilding is finished.

This should finally fix #30315: Temporary proxy files are not erased and old proxys are not updated if the proxy is built more then once (windows)
2012-02-29 12:08:26 +00:00
Nicholas Bishop
33baddfc47 Code cleanup: replace a few macros in CCGSubSurf with inline functions. 2012-02-29 08:35:23 +00:00
Campbell Barton
a6f420b828 update doxygen comments for bmesh. 2012-02-29 06:55:10 +00:00
Nicholas Bishop
b18794c3b6 Add blenlib function to initialize vectors from a single float.
The new functions are copy_v2_fl, copy_v3_fl, and copy_v4_fl.
2012-02-29 04:17:26 +00:00
Mike Erwin
8600c8df43 ndof button handling improvements: Spaceball5000's A,B,C buttons can now be keymapped, ndof modifiers (shift,alt,etc.) are almost ready but still hardcoded to act like keyboard for now. added a check to prevent crash on Linux when device is plugged in after blender starts. also fixed a bug introduced by my last commit that affected the SpaceTraveler and serial devices. 2012-02-29 02:44:08 +00:00
Nicholas Bishop
a71128828f Bugfix: vertexpaint blur brush was broken.
Just a minor loop iteration bug.
2012-02-29 00:14:58 +00:00
Nicholas Bishop
1ebb6e3360 Code cleanup for the neighbor_average() sculpt function.
Moved some of the code into a couple new mesh functions for searching
in poly loops to simplify the function, the rest is just cosmetic
changes.
2012-02-28 23:08:40 +00:00
Campbell Barton
d279fb503d Style Cleanup, no functional changes. 2012-02-28 22:54:09 +00:00
Campbell Barton
e6ca57b929 fix [#30367] Face Fills Crossed
when making a quad from 2 edges - it was comparing the edge lengths to avoid making a bowtie quad. but this doesnt work in all cases, now compare normals instead.
2012-02-28 22:52:09 +00:00
Nicholas Bishop
132544dd02 Fix a couple typos in comments. 2012-02-28 20:55:55 +00:00
Nicholas Bishop
4f884e21b2 Add solid background behind text in search menu.
This fixes the issue of text being hard to read due to (e.g.) black
text on a dark icon.

Example: http://www.pasteall.org/pic/show.php?id=27401
Reviewed by Brecht: http://codereview.appspot.com/5699098/
2012-02-28 20:46:55 +00:00
Campbell Barton
d309aa2d9a fix for leak in bmo_edgenet_fill_exec and remove invalid comment. 2012-02-28 20:06:52 +00:00
Campbell Barton
dcfd1dd7e2 code cleanup: de-duplicate bmesh face creation code, 2012-02-28 19:30:44 +00:00
Campbell Barton
2a7f1af61e Code Cleanup:
- apply some rules for function naming conventions, added to main bmesh doc in bmesh.h.
- remove unused function BM_loops_to_corners().
2012-02-28 19:10:53 +00:00
Campbell Barton
d1d11bbe9b more header re-arranging.
Some function comments were in headers, some in the C files, some in both.
Moved function comments from headers into the C files.
2012-02-28 18:28:30 +00:00
Campbell Barton
df0f0c63d3 bmesh: re-arrange headers 2012-02-28 16:47:12 +00:00
Campbell Barton
c48a5fd821 code cleanup,
- bmesh_newcore.c -> bmesh_core.c.
- add bmesh_interp header.
2012-02-28 16:29:48 +00:00
Campbell Barton
ed04c21374 code cleanup: use float vector size in function definitions, and const's where the values are unchanged. 2012-02-28 14:05:00 +00:00
Campbell Barton
150cedac5d fix [#30361] Edge Length will not be diplayed properly with Clipping Borders
the clipping test done for text drawing was called with local=FALSE, however with mesh info text this needs the local argument to be set.
2012-02-28 13:18:20 +00:00
Campbell Barton
9baab70aaf code cleanup: make clipping enable/disable into functions (was being done inline in drawobject.c) 2012-02-28 13:03:56 +00:00
Campbell Barton
95c14aa685 Fix UI error - some curve settings were in the path panel and were greyed out when 'Path Animation' was disabled, but were infact used for the curve deform modifier.
noticed while looking into bug [#30349].

Move these settings under the main curves panel under text "Path / Curve-Deform:"
2012-02-28 11:18:05 +00:00
Campbell Barton
0d66b57bc2 fix for issue reported in bug [#30381], though it doesn't deal with the crash.
calling DM_ensure_tessface() on an DM_TYPE_EDITBMESH does nothing, which is OK but was printing a warning.
2012-02-28 10:22:21 +00:00
Campbell Barton
b0a09bfab3 code cleanup:
use bmo_* prefix for operator defs, was confusing with bmesh_* api functions.
2012-02-28 09:48:00 +00:00
Campbell Barton
e828b10251 Code Cleanup
* remove one the changes to fix #30374, instead just check if the face exists.
* remove some unneeded edge checks in BM_face_create_quad_tri_v().
2012-02-28 08:17:53 +00:00
Campbell Barton
7536bcbe70 Code Cleanup: bmesh
* remove unneeded struct's from headers.
* give argument names for return ** pointers r_ prefix.
2012-02-28 07:42:48 +00:00
Campbell Barton
94f171f2c6 fix [#30374] Can't Fill Triangular Face
the problem was a triangle couldnt be made when there was a quad that used 3 of the verts.

* now check if overlapping face has same length as the one to be created.
* an unrelated fix - the output of a triangle was not being flagged by the bmesh_contextual_create operator.
2012-02-28 07:19:28 +00:00
Campbell Barton
e6c5ff95be patch [#30331] Support clang-3.0
from Yasuhiro Fujii (y-fujii)

only small part of the patch for now.
2012-02-28 05:19:54 +00:00
Campbell Barton
6dcbba943b bmesh py api - element hide_set() function which flushes hidden state. 2012-02-28 05:02:34 +00:00
Nicholas Bishop
87ddcab933 Bugfix: avoid reading from an OpenGL buffer mapped write-only.
When set to solid-shading, GPU_update_grid_buffers was calling
normal_quad_v3 to output into a mapped buffer, but normal_quad_v3
reads as well as writes.

This fix actually makes a huge performance difference with my drivers
(Gallium/Radeon).
2012-02-28 05:00:28 +00:00
Nicholas Bishop
79fbd39aab Remove DerivedMesh.getFaceMap and create_vert_face_map().
Not used anymore, both have BMesh replacements (DerivedMesh.getPolyMap
and create_vert_poly_map.)
2012-02-28 04:00:56 +00:00
Nicholas Bishop
bfc331dd75 BMesh: use MPoly rather than MFace in multiresModifier_base_apply 2012-02-28 03:54:31 +00:00
Nicholas Bishop
2a4cd1d203 Bugfix for clipping of SEARCH_MENU icon text.
For the preview-icon search menu (used for example in brush
selection), clip the text so that long names don't flow out into the
space between columns.
2012-02-28 01:55:27 +00:00
Campbell Barton
fa38c3dbac bmesh code cleanup - remove most of BKE_bmesh and remove BKE_bmeshCustomData.h. 2012-02-27 21:33:30 +00:00
Campbell Barton
d2cab3e8b0 move bmesh wiki docs into bmesh header and update doxygen.
also have doxygen ignore *.py files and fix some warnings.
2012-02-27 20:27:19 +00:00
Bastien Montagne
40fca4ed21 Quite a warning (unused param in func), was preventing debug build... 2012-02-27 18:20:58 +00:00
Bastien Montagne
49adbe3ab8 Various fixes to UI messages (among other things, all messages needed it should now be capitalized). 2012-02-27 18:14:56 +00:00
Campbell Barton
684a2c8dca fix for error in python context.copy(), calling in byttons view would raise an exception.
buttons view used incorrect return value. -1 is for valid but not set (could use defines/enum here).
2012-02-27 18:08:31 +00:00
Lukas Toenne
050428049f Implements a new operator for detaching nodes. In the process i overhauled the node muting system as well.
There are a number of features that use a kind of "internal linking" in nodes:
1. muting
2. delete + reconnect (restore link to/from node after delete)
3. the new detach operator (same as 2, but don't delete the node)

The desired behavior in all cases is the same: find a sensible mapping of inputs-to-outputs of a node. In the case of muting these links are displayed in red on the node itself. For the other operators they are used to relink connections, such that one gets the best possible ongoing link between previous up- and downstream nodes.

Muting previously used a complicated callback system to ensure consistent behavior in the editor as well as execution in compositor, shader cpu/gpu and texture nodes. This has been greatly simplified by moving the muting step into the node tree localization functions. Any muted node is now bypassed using the generalized nodeInternalRelink function and then removed from the local tree. This way the internal execution system doesn't have to deal with muted nodes at all, as if they are non-existent.

The same function is also used by the delete_reconnect and the new links_detach operators (which work directly in the editor node tree). Detaching nodes is currently keymapped as a translation variant (macro operator): pressing ALTKEY + moving node first detaches and then continues with regular transform operator. The default key is ALT+DKEY though, instead ALT+GKEY, since the latter is already used for the ungroup operator.
2012-02-27 17:38:16 +00:00
Antony Riakiotakis
d55c1d59f9 Fix: confirming edge slide with factor 0 and automerge turned on would delete the selected edges. Caused by automerging the edges with temporary geometry used for the operation, that was getting deleted later. Now deleting the temporary geometry before automerging. 2012-02-27 16:45:48 +00:00
Campbell Barton
96e0f18850 bmesh py api - loop vert/edge/face attributes. 2012-02-27 15:20:54 +00:00
Campbell Barton
4c3e3e93a9 bmesh minor api edits to be a little more typesafe. 2012-02-27 14:57:09 +00:00
Campbell Barton
130668b12f minor bmesh api naming edits. 2012-02-27 14:07:19 +00:00
Campbell Barton
e17bf02c2d Code Cleanup:
* made bmesh_structure.h function names more consistant.
* remove unused code in bmesh_structure.c
* removed 'Edge Flip' operator (missing from bmesh but looked into trunk feature and dont think its worth keeping).
* tagged  some BMESH_TODO's
2012-02-27 13:47:53 +00:00
Sergey Sharybin
08b35cda7f Select edge loop and edge rings operators can't be redone form history menu
so registering them seems to be kind of useless because things like deleting
edge loops with Shift-R command is impossible.

This commit will resolve issue #30375: Loop Select should not become a Redo History Item.
2012-02-27 12:53:23 +00:00
Sergey Sharybin
d7f0e29291 Few files had got +x mode which seems to be totally unnecessary. 2012-02-27 12:48:06 +00:00
Campbell Barton
21f1c99a78 update bmesh design doc and added some comments to the code from it. 2012-02-27 12:25:47 +00:00
Campbell Barton
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
Campbell Barton
120297734b fix for emitting particles (needed tessfaces).
this fixes the cloud-gen addon.
2012-02-27 09:37:59 +00:00
Nicholas Bishop
8fcb66588b Code cleanup, remove redefinition of UNUSED macro.
Patch from Jason Wilkins:
http://projects.blender.org/tracker/index.php?func=detail&aid=30350&group_id=9&atid=127
2012-02-27 02:46:25 +00:00
Campbell Barton
c62a462997 use LIKELY/UNLIKELY macros for operations that run a lot. 2012-02-26 23:59:08 +00:00
Campbell Barton
3ba37b65a3 style cleanup 2012-02-26 22:38:49 +00:00
Daniel Stokes
b200c7a4df Fixing a crash when converting physics objects in the Game Engine. 2012-02-26 21:57:51 +00:00
Campbell Barton
7068fee2dd fix for a bmesh glitch when making a face (Fkey).
On a place, Ctrl+T, Fkey would create a quad overlapping the 2 Tris.

Now this case is checked for in a general way - if the bounds of the face are already filled in with faces (that _only_ use these edges-verts), then dont create the face.

This is an option for the 'edgenet_fill' operator, since creating the face isnt incorrect, just not-what-you-want mostly.

added functions
* BM_edge_share_vert - returns shared vert between 2 edges.
* BM_face_exists_multi, BM_face_exists_multi_edge - check if existing faces fill the edge bounds.
* also add BM_ELEM_INTERNAL_TAG so low level functions can tag without conflicting with higher level functions that also rely on tagging elements.
2012-02-26 21:32:20 +00:00
Campbell Barton
5cfab7f521 bmesh api name change, add _count suffix for BM_*_share functions. 2012-02-26 19:46:12 +00:00
Campbell Barton
c956e5d2d9 modified fix for "Fix [#30351] Solidify Modifier High Quality Normals fails." from r44464.
rather then recalc polygon normals - solidify is simple enough to just flip the normals of the copied faces, the rim faces normals are already re-calculated so copy them.
2012-02-26 18:12:01 +00:00
Campbell Barton
6bc7c30b93 fix for build error with non debug builds from last commit. 2012-02-26 17:24:04 +00:00
Campbell Barton
74e9563b8a * bmesh py api BMEdge.verts was using 2 v1's
* bmesh pu api __repr__ functions for mesh data.
* correct py hash defines.
2012-02-26 17:20:36 +00:00
Campbell Barton
03f5758b48 replace BMESH_ERROR with BMESH_ASSERT, most areas it was used are better suited to an assert anyway.
also tag all error cases as UNLIKELY() for better branch prediction.
2012-02-26 16:39:21 +00:00
Bastien Montagne
5970adaccf Fix [#30351] Solidify Modifier High Quality Normals fails.
Don't really know why, but appears we need to recalc normals when this option is ON.

Also small perf improvement (avoid to compute twice each face normals).
2012-02-26 15:38:28 +00:00
Campbell Barton
62f9959a8e replace bmesh_error with macro that gives the file/line/func the error happens on. 2012-02-26 14:57:41 +00:00
Sergey Sharybin
bed0257414 Fix #30254: VSE: no red warning border on metastrips with Extend (E) 2012-02-26 09:19:48 +00:00
Sergey Sharybin
f268918d50 Fix #30337: missed Set Origin for Metaball
Implemented Set Origin operator for Meta Balls.
2012-02-26 08:55:31 +00:00
Sergey Sharybin
8285fef0e8 Fixed for selected bundles drawing in 3D viewport:
- If track was hidded in clip editor it wasn't highlighted in 3d viewport
  even if it's selected.
- If two tracks has got the same bundle coordinate and one of them is
  selected it might not be highlighted in 3d viewport because of
  draw order.
2012-02-26 08:14:14 +00:00
Campbell Barton
d82c768cc7 bmesh py api, add another interpolation function.
BMVert.copy_from_vert_interp(vert_pair, fac)
2012-02-26 07:16:50 +00:00
Nicholas Bishop
e3877a625e Style cleanup: remove underscore prefix from CCG struct names. 2012-02-26 06:50:54 +00:00
Campbell Barton
1004b03578 bmesh - remove faces with <3 sides after dissolve/collapse (most tools already did this). 2012-02-26 05:48:12 +00:00
Campbell Barton
ff7ddb1925 change vertex dissolve not to collapse edges when its only connected to 2, rather then joining the faces on either side.
This way. IMHO is more useful since it means you can simplify the geometry between faces without joining them and it distinguishes vertex dissolve more from edge dissolve - which will join both faces still.
2012-02-26 05:04:30 +00:00
Nicholas Bishop
c5066df307 Code cleanup: clarify multiresModifier_disp_run modes.
Previously the function took 'invert' and 'add' parameters to indicate
what operation should be performed on the displacements, replaced
these with three named modes: APPLY_DISPLACEMENTS, CALC_DISPLACEMENTS,
and ADD_DISPLACEMENTS.
2012-02-26 04:40:56 +00:00
Campbell Barton
a631b5a651 fix for a bug in bmesh_jekv (and its main caller BM_vert_collapse_faces).
Collapsing an edge could result on 2 edges sharing the same verts, now check for this and 'splice' one edge into another.
2012-02-26 04:38:37 +00:00
Campbell Barton
ebeb815577 fix for vertex dissolve not doing anything with a single vertex on a single face.
now collapse the vertex into the edges.

also disable removing the vertrex when it could not be collapsed (old code), found it could would connected faces which isn't acceptable - now return fail in that case.
2012-02-26 00:43:47 +00:00
Campbell Barton
76acda4417 bmesh python api
* BMLoop attributes link_loop_next/prev
* BMVert.copy_from_face_interp
2012-02-25 23:56:20 +00:00
Campbell Barton
b4b7d809f1 bmesh code cleanup
* minor edits to header
* make BM_vert_dissolve() easier to read.
2012-02-25 23:41:31 +00:00
Campbell Barton
e20d09f079 fix [#30352] Dissolving a vert in an edgeloop (no faces) just deletes the verts killing connections
collapse the vertex into an edge when it has 2 edges connected to it.
2012-02-25 23:29:12 +00:00
Campbell Barton
c65b3b73fd bmesh api cleanup
* better type safety for BM_elem_flag_* and BM_elem_index_* functions.
* add BMElem type to be used where BMFace/Edge/Vert/Loop can be interchanged.
* fix bug in select manifold, found when making functions more strict.
2012-02-25 22:23:40 +00:00
Campbell Barton
72e1316dc4 minor style edits
- use GL_TRUE/FALSE for glLightModeli
- use set for python checks against multiple string values.
2012-02-25 21:27:45 +00:00
Campbell Barton
98aececc8e bmesh code cleanup
* change BMO_elem_flag_* defines to inline functions.
* BMO_slot_map_insert() is too big for an inline function - un-inline it.
* remove redundant casts.
2012-02-25 20:58:03 +00:00
Campbell Barton
55e68985e7 bmesh api:
* added BM_elem_flag_set, BMO_elem_flag_set. to avoid 'if(...) enable(); else disable();' all over the place.
* added bmesh_operator_api_inline.c, the header file was getting messy.
2012-02-25 19:43:51 +00:00
Campbell Barton
0096370db8 fix for own error edge tagging sharp. 2012-02-25 18:13:58 +00:00
Sergey Sharybin
79f9964cdb Changes in double side lighting usage
Disabled double-side lighting by default and changed areas which are using
double sided lighting to switch it off just after doing stuff which requires
double side.

This makes code a bit more simple to follow (no all that disabling double side
lighting all over the code and so).

This change also fixes crash of blender caused by intel gme965 driver which
leads to stack corruption in some place when double side lighting isn't
disabled (probably driver still kind of using double side in some areas or so).

Hopefully it'll also fix #30293: Converting Text to Mesh

Thanks to Campbell to assist writing this patch!
2012-02-25 18:09:39 +00:00
Campbell Barton
3fc2fbc333 style cleanup, use { on newline after function definition.
spelling 'impliment' -> 'implement'
2012-02-25 16:49:59 +00:00