Commit Graph

36817 Commits

Author SHA1 Message Date
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
Luca Bonavita
0fe519f14a == Python API docs ==
Adding two new command line options (-f = full rebuild, -t = testing) so that we don't have to edit the file each time
2012-03-05 14:12:38 +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