Commit Graph

48210 Commits

Author SHA1 Message Date
Dalai Felinto
f809eef968 Muti-View: viewport crashes when empty is active camera - reported over IRC by Campbell Barton 2015-04-27 10:41:40 -03:00
Dalai Felinto
b315fcb7ed Fix T44514 Crash under cycles rendering using F12, based on patch from Gaia Clary 2015-04-27 10:41:40 -03:00
Campbell Barton
e1ed47eb5b Fix T44512: Cycles fails normal bake /w scale flip 2015-04-27 22:46:15 +10:00
Campbell Barton
9dadc8f599 Math Lib: add mul_v3_mat3_m4v3 2015-04-27 21:52:42 +10:00
Campbell Barton
3f80accfb3 Fix T44011: Ruler/Knife/Loop-cut fail in quad-view
This is a kind of sloppy-focus,
resolving long standing bug with loop-cut/knife/ruler /w quad-view.

Where activating a tool would lock onto one of quad-views,
especially problematic when activating from the toolbar or menus.
2015-04-27 19:17:07 +10:00
Campbell Barton
5df939fd15 Py API: expose operator runtime flags
eg from operator invoke/execute:
    self.options.is_grab_cursor
2015-04-27 19:00:10 +10:00
Campbell Barton
5e1eb8cdcf Cleanup: rename GRAB_POINTER -> GRAB_CURSOR
Term pointer is overloaded already.
2015-04-27 18:58:53 +10:00
Campbell Barton
ddb5f96295 Sculpt: symmetrize was leaving edge-tags dirty
This is used for the edge-queue
2015-04-27 03:35:16 +10:00
Campbell Barton
24448e11fb Correct own error in recent sculpt changes
mixed up squared nonsquared length, also remove invalid verify check.
2015-04-27 03:34:13 +10:00
Julian Eisel
cf366c8b66 UI: 'View Online Manual' Shortcut
D1031, implement proposal T37478 to give easy access to the online manual.

Use Alt+F1 while hovering over a button/setting.
2015-04-27 01:35:24 +10:00
Porteries Tristan
5efbd2a407 BGE : addObject in python without reference object.
Making the reference argument optional for the addObject function.
```
scene.addObject("Cube")
```

This allows to keep the rotation, scale and position of the original object.
To avoid layer problems with lights if the reference arguments is None, the new object have the same layer than the active layers in scene.

Reviewers: lordloki, moguri, hg1, sybren

Reviewed By: hg1, sybren

Subscribers: agoose77

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1222
2015-04-26 16:29:58 +02:00
Campbell Barton
3524676036 BMesh: increase subdiv smooth strength
Now 1.0 gives near spherical output
2015-04-26 21:26:45 +10:00
Campbell Barton
2069187a1b Cleanup: bmesh subdivide
var names were a bit cryptic, set return arg last.
2015-04-26 20:34:03 +10:00
Campbell Barton
2374cb380b BMesh: subdiv smooth, use simpler even calculation
Was checking all vertices adjacent faces,
now just compare the difference between normal angles.

Also default to inverse-square for loopcut-subdiv falloff.
2015-04-26 19:20:34 +10:00
Campbell Barton
e1ca127419 Cleanup: subdivide smooth vertex placement 2015-04-26 19:12:20 +10:00
Campbell Barton
6e02f1da74 BMesh: use inverse-square falloff /w smooth-subdiv
Resolves ugly artifacts with multi-cut.
2015-04-26 18:35:42 +10:00
Campbell Barton
c2f7cffd56 Add inverse-square falloff to bmesh, mask & compo. 2015-04-26 18:31:54 +10:00
Campbell Barton
d33314393e BMesh: use const for API calls 2015-04-26 17:19:51 +10:00
Campbell Barton
12e7c7f674 BMesh: BM_ELEM_CD_GET_VOID_P cast removed const 2015-04-26 17:19:51 +10:00
Campbell Barton
3917e9f1f2 Macro GENERIC_TYPE_ANY map many types to one value 2015-04-26 17:19:51 +10:00
Campbell Barton
01dda9a434 correct own error in recent ngon creation edit 2015-04-25 21:16:58 +10:00
Campbell Barton
9eb191083a Fix neg-scaled project-paint in perspective mode 2015-04-25 20:47:19 +10:00
Campbell Barton
89f5a09ab4 Cleanup: use 8 space indent for multi-line args 2015-04-25 20:15:20 +10:00
Campbell Barton
a7381cca34 BMesh: simplify BM_face_create_ngon
Was doing quite a lot of unnecessary steps.
Now construct the sorted verts, edges /w error checking, in a single loop.
2015-04-25 17:26:22 +10:00
Julian Eisel
a4203814d1 UI: Panel drag-collapse
D1233, Adds a way to quickly open/close multiple panels by holding LMB and dragging over the desired panels,
Suggested by @maxon

The decision if the panels are opened or closed is made based on the first Panel the user drags over.
If it is closed, all panels he drags over are opened
(including the first one) if it's opened, they get closed (matching existing drag-toggle logic).
2015-04-25 13:11:32 +10:00
Campbell Barton
0221a11c95 Project Paint: save 8 bytes per pixel (re-align) 2015-04-25 12:54:55 +10:00
Campbell Barton
86d3a1f683 Cleanup 2015-04-25 12:29:52 +10:00
Julian Eisel
3bffcc675b Fix T42495: Fullscreen area icon glitch
Tried a couple of things to trigger an update/redraw for the exact right
moment (sending azone update event, timer, delayed redraw, etc) but this
seems to work rock solid without being *that* ugly.
2015-04-25 01:29:53 +02:00
Julian Eisel
de8e89d4f5 Fix T44405: Importing keyconfig with changed shortcut in "Screen Global"
causes rapid fullscreen toggeling
2015-04-24 20:08:52 +02:00
Dalai Felinto
7e66f0e9d4 Multi-View: Set Stereo 3D operator support for EXEC calls 2015-04-24 13:07:33 -03:00
Dalai Felinto
27ac96dbae Multi-View: rolls back to a non quadbuffer friendly window if displaymode changes from pageflip to something else
In some cases the graphic card supports quadbuffer, but not the display.
In this case it is nice to go back to a window that does not have
quadbuffer if you change back to anaglyph, interlace, ...

Otherwise you may be stuck with a flickering window
2015-04-24 13:06:49 -03:00
Dalai Felinto
fb17a3fb76 Multi-View: Time Sequencial (aka pageflip, aka quadbuffer) stereo support
TODO: I would be nicer if we could set win at file opening to the
current open window, but I'll implement this later.
2015-04-24 12:00:16 -03:00
Ines Almeida
324751259e correcting typos in python api docs 2015-04-24 14:08:31 +01:00
Antony Riakiotakis
80d75cb3e4 Add debug option --debug-gpumem to show GPU memory used in status bar.
Only used in ATIs and NVIDIAs. Used extensions are:

https://www.opengl.org/registry/specs/ATI/meminfo.txt
http://developer.download.nvidia.com/opengl/specs/

If you read the documentation, the numbers are not supposed to be exact
and also depend on the time when the call is made. The numbers can also
change quite quickly. It's only meant to give a rough measure of what is
going on.
2015-04-24 14:11:21 +02:00
Howard Trickey
c2f861453e Fix T44492: knife tool should cut across a split edge.
Added filter condition in visibility check that prevented
a "butting-up-against" face from obscuring an edge.
2015-04-24 07:29:45 -04:00
Porteries Tristan
546031b694 BGE : fix bugs with physics collision mask/group
Currently there are bugs with physics objects in inactive layers,
character and softbody.
I added a function in CcdPhysicsEnvironement to know if a physics
controller is currently active and for soft body I added the correct function in UpdateCcdPhysicsController to re-add a softbody in the dynamics world.

The bug was introduced in D1243 commit 3d55859

Reviewers: hg1, scorpion81, lordloki, moguri, agoose77, sergof

Reviewed By: sergof

Subscribers: youle, moguri

Differential Revision: https://developer.blender.org/D1253
2015-04-24 11:57:38 +02:00
Antony Riakiotakis
c884ac28a7 3D Textures:
If we fail allocating a proxy texture don't fail, instead create a
smaller nearest filtered image to display in its place.

This can make viewing slow (it's an extra O^3 operation), but this will
probably help us render the tornado in 3D viewport in gooseberry and
still actually see something - despite the rendering taking longer.
I've added a debug print so we can know when this happens.
2015-04-24 11:35:57 +02:00
Campbell Barton
bdf6393c98 Math Lib: pow_i for int power-of 2015-04-24 11:37:48 +10:00
Campbell Barton
f829f556b4 Fix project painting on a negative scaled object 2015-04-24 11:04:27 +10:00
Dalai Felinto
efe41ae7fd Multiview: Quadbuffer (time sequential) working [debug builds only]
I'll enable this mode in Release builds once I figure out how to best
handle opening files that are saved with the quadbuffer mode.

In fact I think no display mode should be saved/read from a file.

Tested in Linux with NVidia 3D Vision and NVidia 3D Vision Pro with
NVidia Quadro FX 580 and Quadro FX 4600.

(kudos for the Visgraf Lab at IMPA, for having me around with all those
gadgets ;)

Thanks for Cédric Paille (cedricp) for the code snippets and tests -
T44327
2015-04-23 19:50:52 -03:00
Campbell Barton
0217e6517f Cleanup: minor edits 2015-04-24 07:32:43 +10:00
Dalai Felinto
1076adb458 OpenEXR: RenderResult should always have a RenderView 2015-04-23 18:16:55 -03:00
Campbell Barton
dc734da46e Cleanup: casts, correct debug ifdefs 2015-04-24 07:08:07 +10:00
Campbell Barton
97b1f22bc3 Project Paint: minor optimization comparing angles 2015-04-24 06:41:39 +10:00
Bastien Montagne
f75c89b3f4 Fix T44461: Crash and file corruption after calc_normals_split, calc_tessface execution.
This one was nasty, issue comes with temp/nofree CD layers that get 'removed on the fly'
from saved mesh CDData. Since mesh struct itself was written before that cleanup, it would
still have the old, invalid number of layers. That would lead to a buffer overflow when
loading data later (odd you had to do this twice (i.e. have 2 'ghost' layers) to get the crash).

New code prevents that by always making a copy of the mesh (we were already doing that mostly
anyway, since we were saving without tessfaces), copying (by ref of course) in it cddata,
and then writing mesh struct. Makes code a bit more verbose, but... it works!
2015-04-23 20:53:12 +02:00
Campbell Barton
18ee593729 Expose CD_PAINT_MASK to Python API
D782 by Stanislav Blinov
2015-04-24 04:10:51 +10:00
Antony Riakiotakis
d2f35d6d50 3D textures: detect if we are pushing OpenGL too hard with the texture
size.
2015-04-23 19:02:37 +02:00
Campbell Barton
61ac5dd5ba Correct missing NULL check (own mistake) 2015-04-24 02:38:15 +10:00
Campbell Barton
372752c739 Math Lib: add count_bits_i utility function 2015-04-24 01:37:12 +10:00
Campbell Barton
27e03dcd21 Fix T44422: Zoom to mouse fails in camera view
Camera now supports all zoom styles too.
2015-04-24 00:18:42 +10:00
Dalai Felinto
22b564f93e Fix T44498 - Blender crashes in some files after render slots fix
This is a temporary fix until I get to investigate it more carefully.
It will help if the report could include the steps to reproduce it
besides the buggy file.

Note: RenderResult should *always* have at least a valid RenderView,
which is not what happens here.
2015-04-23 11:01:56 -03:00
Antony Riakiotakis
bcac112dde Fix T44494 crop node changes values during execution.
We used the node data as a store for node execution,
bad idea, since the data itself is a template from which
execution data should be derived, never to be modified during execution.
2015-04-23 14:23:42 +02:00
Julian Eisel
2dfbf31a41 Display slot menu in Properties Region even if render slot is empty
For the records, this one is caused by 31f984bc3ffcc838343, it wasn't
implemented at all ;)
2015-04-23 13:33:29 +02:00
Julian Eisel
85e455b245 Fix slot menu not displayed if render result slot is empty
Caused by own mistake in 31f984bc3ffcc83834, reported by @sebastian_k in
IRC
2015-04-23 13:21:36 +02:00
Campbell Barton
8010672bbc BMesh: mesh-data picking, edge+vert improvement
When zoomed out vert bias over edges meant it wasn't possible to select edges.
Now pick the edge if the cursor is closer to its center.
2015-04-23 16:11:54 +10:00
Campbell Barton
87b3e62b3d Cleanup: warnings 2015-04-23 16:09:30 +10:00
Dalai Felinto
ecb3362a24 Fix T44396 - Compositing render slots don't work
Note 1: If you go to a render slot previously rendered and change
something in the compositing the buffer will still vanish.

This is an old bug, T44181, and not addressed here
(I'm basically just fixing the regression introduced with multiview)

Note 2: I have a work in progress patch to get rid of
RenderResult->rectf/rect32/rectz entirely. It still not working, and we
should have a working code base before doing refactoring anyways.
2015-04-22 18:48:31 -03:00
Bastien Montagne
6a1c123df4 Fix broken uiTemplateIconView().
Was using enum **value** as **icon id**... tripple sigh!
Guess it was working for its only current use (matcaps), but still.
2015-04-22 22:48:40 +02:00
Julian Eisel
90b7652334 Fix T44472: Stereo 3D save options missing in File Browser 2015-04-22 21:50:49 +02:00
Dalai Felinto
4a8421faa4 Fix T44463 - crash on "Full Sample" 2015-04-22 16:40:21 -03:00
Julian Eisel
31f984bc3f Show buttons to change render layer/pass in UV Editor header
Previousely this was "hidden" in the Properties Region, this makes it
more visible/usable.

Requested by @sebastian_k
2015-04-22 20:43:43 +02:00
Sergey Sharybin
147d0cdf98 Tracking: Show plane track outline if image failed to load 2015-04-22 23:20:00 +05:00
Sergey Sharybin
f35489fa94 Tracking: Fix missing pointer array check when reading plane track
This could cause memory corruption when moving files from system with one
bitness to another.
2015-04-22 23:00:41 +05:00
Antony Riakiotakis
3174cbe8f2 Double click selection on animation channels selects all keyframes of the range 2015-04-22 19:28:07 +02:00
Tamito Kajiyama
3da7226844 Freestyle: Fixed a crash due to missing call of StrokeShader.__init__() in Python.
Many thanks to the problem report by flokkievids (Folkert de Vries)
through a comment in Patch D963.
2015-04-23 01:12:55 +09:00
Julian Eisel
798facbff3 Fix crashes when moving game property with invalid index (from py/redo
panel)

Also hides index option in redo panel to be consistent with similar
operators
2015-04-22 17:20:10 +02:00
Antony Riakiotakis
d354eeab74 Placeholder image strips feedback session changes no.2:
Change paths operator can also have the same placeholder logic now
2015-04-22 14:11:51 +02:00
Antony Riakiotakis
e7c2d244c3 Placeholder image strips feedback session changes no.1:
Autodetect range of strips.
2015-04-22 14:11:51 +02:00
Antony Riakiotakis
62d10cd833 Placeholders for sequencer take one.
Placeholder images, means that the image sequence reserves a range for
images, displaying black while we wait for them to finish rendering.

This is meant as a feature to not break the layout of gooseberry
sequence edits while we wait for those frames to arrive.
2015-04-22 14:11:51 +02:00
Julian Eisel
dc36e1fe39 Fix T44476: Hiding Grease Pencil from Outliner RMB doesn't update 3D
View
2015-04-22 14:02:48 +02:00
Julian Eisel
18aaae101a Fix T44477: Overlapping tooltips in Outliner
Tooltips for buttons in the Outliner could overlap the Outliner's RMB
menu in some cases (and there's no way to get rid of the tooltip again).
This disables the button's tooltip before creating the menu (as we do it
for the normal RMB menu)
2015-04-22 13:41:43 +02:00
Antony Riakiotakis
1044dfd965 Fix and simplify vertical positioning and calculation of metadata
display more.
2015-04-22 13:19:58 +02:00
Antony Riakiotakis
818a0cdc76 Fix stamp missing after multiview merge.
Was not using acquired render result correctly, most likely a copy paste
error.
2015-04-22 12:03:06 +02:00
Antony Riakiotakis
97587dc5d6 Stamp cannot be written to file.
Make sure stamp data is avaliable before writing stamp to image - this
still does not fix stamp, looks like issue is availability of the images
themselves for the view, investigating next.
2015-04-22 11:50:57 +02:00
Sergey Sharybin
414990b0f1 Tracking: Some more code de-duplication 2015-04-22 12:46:29 +05:00
Sergey Sharybin
18a47b67fd Tracking: Code cleanup, de-duplicate some code in tracking context finish 2015-04-22 12:34:01 +05:00
Campbell Barton
e6ceecdf97 Cleanup: pep8, spelling 2015-04-22 16:26:54 +10:00
Bastien Montagne
4da050674e Fix T44470: File Selection sometimes surpresses last Character.
Tweak hack of `file_draw_string()` (there may be better solution, but not worth
spending time on this, the whole filebrowser drawing code is to be rewritten anyway).
2015-04-22 08:15:05 +02:00
Bastien Montagne
e1a53b6d52 Fix T44475: Merge option of Mirror Modifier behavior reversed.
Glitch in rB57d9badc.
2015-04-22 07:54:14 +02:00
Tristan Porteries
a8adeeb6fb Logic Editor: Buttons for moving game properties up/down
D1163 by @panzergame, with minor edits by me (@Severin)
2015-04-21 23:33:45 +02:00
Sergey Sharybin
b35743d39f Tracking: Add missing plane track remapping when joining two point tracks 2015-04-22 02:10:50 +05:00
Sergey Sharybin
260f75a2ca Tracking: Cleanup, move some plane tracks code to utility functions 2015-04-22 02:10:50 +05:00
Dalai Felinto
9425a8ff38 BGE: scene.pre_draw_setup[] callback
This callback allows the user to change the camera data right before the
rendering calculations.

scene.pre_draw[] is not enough here, because if you want to change the
camera matrices (projection/modelview) the culling test is done before
that (after pre_draw_setup[] though).

Reviewers: moguri, campbellbarton

Differential Revision: https://developer.blender.org/D1251

Python sample code using this. The sample scene would need a default
camera (not used for rendering), a dummy camera ('Camera.VR'), and two
cameras ('Camera.Left', 'Camera.Right') that will be used for the actual
rendering.

```
import bge

def callback():
    scene = bge.logic.getCurrentScene()
    objects = scene.objects

    vr_camera = objects.get('Camera.VR')

    if bge.render.getStereoEye() ==  bge.render.LEFT_EYE:
        camera = objects.get('Camera.Left')
    else:
        camera = objects.get('Camera.Right')

    vr_camera.worldOrientation = camera.worldOrientation
    vr_camera.worldPosition =  camera.worldPosition

def init():
    scene = bge.logic.getCurrentScene()
    main_camera = scene.active_camera
    main_camera.useViewport = True

   scene.pre_draw_setup.append(callback)

    objects = scene.objects
    vr_camera = objects.get('Camera.VR')
    vr_camera.useViewport = True
    vr_camera.setViewport(
            0,
            0,
            bge.render.getWindowWidth(),
            bge.render.getWindowHeight() )
```
2015-04-21 17:41:23 -03:00
Sergey Sharybin
f2956d5fc7 Tracking: Fix over-allocation in plane track's point tracks pointers when removing point track 2015-04-22 01:36:15 +05:00
Julian Eisel
6885d316b1 Fix T44474: Rotation manipulator not hidden completely with all axes
locked

Really doesn't look like a bug on a first glance but the line of code
that was there previously seemed to be there to prevent the manipulator
from drawing in this case.
2015-04-21 21:55:19 +02:00
Campbell Barton
bf69453ae7 BLI_string: add BLI_snprintf_rlen
use when the length of the destination string is needed.
2015-04-22 05:37:22 +10:00
Campbell Barton
c9f9e29538 Math Lib: handling bits handling into own file 2015-04-22 04:44:24 +10:00
Campbell Barton
b47892e9f5 Minor edits to metadata commit
No need to calculate height of each line, just use height of font.
2015-04-22 04:43:13 +10:00
Antony Riakiotakis
e1ce83f762 Initialize and use the theme for metadata text 2015-04-21 19:01:09 +02:00
Antony Riakiotakis
58c511fb01 Stamp refactoring:
Write those on render result during rendering, so we can cleanly write a
render result image after rendering.
2015-04-21 18:37:06 +02:00
Antony Riakiotakis
3091ea49fe Metadata:
* Theme support for metadata display
* Increase text DPI with scaling.
2015-04-21 18:37:06 +02:00
Antony Riakiotakis
50bfc4bfa0 Metadata display support - patch by Julian and me.
Basically, blender adds a few metadata fields to images when
we render an image. Those metadata can now be viewed in the
image editor.

Also, made sure metadata are available when we write imbufs
to disc with "Save As". There may be more cases here that need
fixing, but this means that loading an image with metadata
will now properly preserve them in blender.
2015-04-21 18:37:06 +02:00
Julian Eisel
f9972fa53e VSE: Allow GPencil drawing without having a strip loaded
Previously the GPencil strokes were just not drawn (even though they
were generated) until a strip was loaded.
2015-04-21 17:44:11 +02:00
Campbell Barton
84d117b3ad Minor edit to edit-mesh selection bias
only choose verts over edges (not faces)
2015-04-22 00:43:31 +10:00
Campbell Barton
3a3f80673c Cleanup: minor corrections 2015-04-22 00:16:26 +10:00
Julian Eisel
de687b6fa0 Fix T44465: Crash using VSE OGL render + Grease Pencil
Likely caused by rBd5f1b9c22233
2015-04-21 16:04:14 +02:00
Campbell Barton
e3a6440e7a BMesh: mesh-data picking, general improvements
Generalize logic for vert/edge/face selection:
- index cycling.
- selection bias with mixed modes.

Details:
- Edges now support index cycling (as verts/faces did already)
- Cycling over near elements is now only enabled when the mouse position remains the same.
- No longer do 2 selection passes to perform index cycling.

Fixes:
- Edges behind the view could be selected (surprising nobody reported!)
- Selection bias now only changes the element that gets picked without interning the return distance
  (was buggy with mixed modes).
2015-04-21 21:25:43 +10:00
Antony Riakiotakis
907d4d310f Backdrop strictly shows image result only - it could get influenced by
scopes setting of space if one changed the space type back and forth.

Thanks to Sergey for reporting.
2015-04-21 12:13:02 +02:00
Campbell Barton
b82d571c85 Cleanup: style 2015-04-21 15:53:32 +10:00
Campbell Barton
f36e91ad0a Correct crash in last commit (spacebar search) 2015-04-21 15:18:34 +10:00
Julian Eisel
56a93e9cb1 Add eyedropper for selecting object & obdata
In addition to the unlink icon to clear a value,
When cleared, show an eyedropper to select objects or object-data
(was already available via the EKey).
2015-04-21 14:25:03 +10:00
Campbell Barton
912397756a Fix T44432: Zoom to mouse fails /w FCurve editor 2015-04-21 13:10:32 +10:00
Campbell Barton
62e149881a Fixes for backbuf selection logic
- Fix ED_view3d_backbuf_sample_rect, r_dist was set completely wrong.
- Avoid duplicate calculations picking the nearest edge.
- Bias against picking selected edges is now optional.
- Remove unused callback reading the backbuf.
- Remove unused strict option picking vertices.
2015-04-21 04:50:39 +10:00
Campbell Barton
aa880bb815 Cleanup: use ED_view3d_backbuf_* prefix 2015-04-21 03:19:27 +10:00
Campbell Barton
d57a93a7cb Fix T44383: Select face fails in some positions
When mixing vert/edge/face with select-visible,
face selection could fail when not close enough to the center.

This also fixes a bug where the bias for verts over edges would
prefer faces over edges too, making edges harder to pick.

Mixing edge with other selection modes works more predictably now.
2015-04-21 03:10:32 +10:00
Campbell Barton
0626d27bf6 Editmesh select nearest fixes
- distance from edge check wasn't clamping 0-1
- vertex bias wasn't taking pixelsize into account.
- index & pass counter were floats

Also some improvements

- use BMesh lookup tables when available.
- use structs to avoid issues getting out of sync.
2015-04-21 01:50:21 +10:00
Campbell Barton
60e8e20132 Cleanup: use macro for common view3d zbuf check 2015-04-21 01:50:20 +10:00
Campbell Barton
57d9badc21 Cleanup: use bool /w flag checks 2015-04-21 01:50:20 +10:00
Bastien Montagne
4d5446cea7 Usual UI messages fixes... 2015-04-20 14:46:09 +02:00
Campbell Barton
6bc26540c2 Fix T44452: Inconsistent gpencil color in prefs 2015-04-20 21:20:39 +10:00
Campbell Barton
fa761dfe6d Fix T44419: extruding when using lasso deselect 2015-04-20 21:10:52 +10:00
Campbell Barton
437f69ab45 Allow Python overrides for materials. 2015-04-20 20:20:33 +10:00
Antony Riakiotakis
9b4c8a2507 Fix T44458 strip modifier mask not copied correctly when doing scene
copy.

What happens is that the strip is copied, but it still refers to the old
scene. Here we need to fix this by referring to the copy of the strip
and also do it after copying to make it order independent.
2015-04-20 11:51:43 +02:00
Sergey Sharybin
0aa2eed0c2 Compilation error fix for MSVC: It does not support expressions in array
declarations
2015-04-20 14:07:26 +05:00
Sybren A. Stüvel
bf6bde232d Fix: BGE crashes when RunPythonCallBackList() is called with maxargcount != minargcount 2015-04-20 13:53:54 +08:00
Joshua Leung
dbb2b29bea Action Stashing: Newly stashed strips now get "sync length" option enabled by default 2015-04-20 17:27:59 +12:00
Joshua Leung
a0e1b6573a Action Editor "Browse" Fix: Stash active action if nothing else uses it
Following the initial action management commits for 2.74, blurrymind pointed out a
problematic workflow involving the "Browse Action" dropdown in the Action Editor
which would lead to actions being accidentally lost. Namely, it turns out that
game animators frequently flip between different actions from the Browse menu while
working.

While the new up/down operators and/or other NLA based tools are better suited to this
without the problems of actions getting lost, some additional precautions were needed
for the Browse menu as well. So now, if the active action will have no users as a result
of the switch (i.e. it was a new action, and the user is checking on a previous action
via the Browse menu), this action will now get stashed. This workflow is not perfect though,
as there is the problem of the stashed action strips not reflecting the actions they reference.
2015-04-20 17:27:58 +12:00
Joshua Leung
689241b6e5 Fix for potential null-pointer-dereference if the new action is NULL 2015-04-20 17:27:57 +12:00
Joshua Leung
e4fbc8fc8d Fix: Changing actions in the Action Editor using the Browse dropdown should happen in tweakmode
When a NLA strip is being tweaked, it should not be possible to use the Action Editor to change
the action that it uses. Instead of changing the action in tweakmode, it now exits tweakmode
first before doing so.
2015-04-20 17:27:56 +12:00
Joshua Leung
5f6b958e96 Fix: "show_points" setting for Grease Pencil drawing didn't work
As reported by zeffi, the "show_points" option was not working in master.
It probably broke recently, after some changes meant that the point sizes
weren't geting set prior to drawing these points anymore. Since this was
originally added as a debugging tool (though it is now somewhat redundant
due to the stroke editing functionality, which uses/exposes the same points),
this option wasn't really that important. I have decided to add back a toggle
for this to the UI though, since it can be used for some interesting effects...
2015-04-20 17:27:55 +12:00
Campbell Barton
79319b3fba Sculpt: remove workaround T25371
It's no longer needed,
and made calc_area_normal different to the normal from calc_area_normal_and_center.
2015-04-20 13:36:51 +10:00
Campbell Barton
436004b6b1 Sculpt: clay-strips was missing accumulate button
Correct & de-duplicate check for accumulate.
2015-04-20 13:23:47 +10:00
Sybren A. Stüvel
07a7d77ec1 Fix: solved BGE compiler error on Linux/gcc 2015-04-20 10:58:25 +08:00
Porteries Tristan
62f79856e9 BGE : Standardization of callbacks execution.
A new function (RunPythonCallBackList) to call all python functions
contained in a python list was developed.

This function has:
  - first argument is the python list of callbacks
  - second argument is a python list of arguments
  - third argument is the minimum quantity of arguments
  - forth argument is the maximum quantity of arguments

It improves flexibility and supports *args.

Reviewers: moguri, dfelinto, campbellbarton, sybren

Reviewed By: campbellbarton, sybren

Subscribers: sybren

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1102
2015-04-19 20:33:08 +02:00
Campbell Barton
6f0f1dc3be Cleanup: warnings 2015-04-19 22:03:42 +10:00
Campbell Barton
e5048dd4ca Dyntopo: non-topology tool origdata support
Brushes that don't change topology didn't have access to original data.
2015-04-19 19:56:46 +10:00
Campbell Barton
ac73fe5fe0 Cleanup: use meaningful names re: (fc, an, sn) 2015-04-19 18:38:58 +10:00
Campbell Barton
fb6a0d24e1 Dyntopo: support for original normal access
Rename calc_flatten_center to calc_area_center,
since theres no 'flatten' spesific logic there.

Also refactor calc_area_center, calc_area_normal, calc_area_normal_and_center
so they're next to eachother - they're almost the same,
having them scattered about isn't helpful.
2015-04-19 18:24:21 +10:00
Campbell Barton
fe39ebea12 Cleanup: move project code into util function 2015-04-19 17:52:35 +10:00
Campbell Barton
57b020528b Cleanup: calculating sculpt center & normal
also avoid sqrt calculating dyntopo center (only checks for flipping)
2015-04-19 17:03:51 +10:00
Campbell Barton
eb4fb4f4fe disable verify from last commit (too slow) 2015-04-19 16:06:40 +10:00
Campbell Barton
d09a9a9597 Dyntopo: USE_EDGEQUEUE_TAG broke even subdiv
While adding edges to the queue multiple times is redundant,
walking over them is still needed.
2015-04-19 16:03:12 +10:00
Campbell Barton
550c3c2c1e Dyntopo: avoid over-counting /w neighbor average 2015-04-19 14:46:32 +10:00
Campbell Barton
2448c21cb3 Sculpt: avoid CD lookup /w mask smooth 2015-04-19 14:46:32 +10:00
Campbell Barton
9ac618a90e Sculpt: smooth brush, exclude self from average
Was including the vertices own location when accumulating.
2015-04-19 14:46:32 +10:00
Porteries Tristan
3d55859924 BGE: Support for collision group/mask from the api + activated on EndObject.
A Python API for the collision group / mask has been added:
```
KX_GameObject.collisionGroup
KX_GameObject.collisionMask
```
The maximum number of collision groups and masked has been increased from eight to sixteen.
This means that the max value of collisionGroup/Mask is (2 ** 16) - 1

EndObject will now activate objects that were sleeping and colliding with the removed object.
This means that, unlike now, if a rigid body starts sleeping on top of another object, when the latter is removed the rigid body will activate and fall, rather than float midair as before.

Collision groups that do not intersect used to collide on the first frame. Now this has been fixed so that they collide appropriately.

Thanks to agoose77 for his help.

Reviewers: scorpion81, hg1, agoose77, sergof

Reviewed By: agoose77, sergof

Subscribers: sergof, moguri

Projects: #game_physics, #game_engine

Differential Revision: https://developer.blender.org/D1243
2015-04-19 01:04:22 +02:00
Porteries Tristan
a2f9a0cfd9 BGE: Fix T43536 logic.getCurrentScene() returning wrong scene in
pre_draw and post_draw calls

A simple insert of KX_SetActiveScene(scene) before pre_draw and
post_draw calls solves the issue.

Reviewers: dfelinto, sybren, brita_, campbellbarton, moguri, lordloki

Reviewed By: moguri, lordloki

Projects: #game_logic, #game_engine

Differential Revision: https://developer.blender.org/D1129
2015-04-18 21:37:59 +02:00
Campbell Barton
252b0cf5d2 Cleanup: API naming use BKE_undo_ prefix 2015-04-18 18:25:07 +02:00
Campbell Barton
38bea4e86c Cleanup: use BLO_memfile prefix 2015-04-18 18:11:01 +02:00
Antony Riakiotakis
230712e6cb Autosave:
Flush edits only when saving global undo. This will stop freeing of PBVH
in sculpt mode, which introduces some pretty severe freezes, especially
in dyntopo. For global undo we flush the contents of the global undo
buffer which does not include localized edits of sculpt/edit mode, so
those data will not get saved anyway.
2015-04-18 15:50:29 +02:00
Porteries Tristan
4f2657bf47 BGE: New Draw debug shadow box for sun lamp
New Check option "Show Shadow Box" in shadow panel of sun lamp to get
feedback about which objects project shadows.

Minor tweaks by Campbell Barton and Jorge Bernal

Reviewers: moguri, sybren, kupoman, dfelinto, lordloki, campbellbarton

Reviewed By: lordloki, campbellbarton

Subscribers: sergey, lordloki

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1149
2015-04-18 12:30:02 +02:00
Campbell Barton
3a4a2a9427 Fix T44390: Clay brush weirdness part-2
Use the normal of the plane instead of the vertex normal,
since projecting using the vertex normal frequently causes artifacts.
2015-04-18 05:08:14 +10:00
Campbell Barton
05b6de545a Fix T44390: Clay brush weirdness part-1
Clay brush had a feedback loop with dyntopo,
getting the plane from the cursor center didn't support original data.
2015-04-18 05:08:03 +10:00
Campbell Barton
b0c2fdd927 Cleanup: simplify sculpt normal accumulation 2015-04-18 03:09:16 +10:00
Campbell Barton
28b9a0276f Cleanup: simplify sculpt plane accumulation 2015-04-18 02:54:49 +10:00
Porteries Tristan
e0aeafdf0a BGE : Fix light layer check
The layers in Blender are using a bit field for the 20 layers. The light layer value was limited to 20, so the highest usable light layer was five.
The patch modify the range and add layer out of range error messages.

Reviewers: sybren, hg1, moguri

Reviewed By: hg1, moguri

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1238
2015-04-17 18:12:51 +02:00
Dalai Felinto
394c5318c6 Bake-API: reduce memory footprint when baking more than one object (Fix T41092)
Combine all the highpoly pixel arrays into a single array with a lookup
object_id for each of the highpoly objects.

Note: This changes the Bake API, external engines should refer to the
bake_api.c for the latest API.

Many thanks for Sergey Sharybin for the complete review, changes
suggestion and feedback. (you rock!)

Reviewers: sergey

Subscribers: pildanovak, marcclintdion, monio, metalliandy, brecht

Maniphest Tasks: T41092

Differential Revision: https://developer.blender.org/D772
2015-04-17 12:25:37 -03:00
Campbell Barton
45e929dc12 Cleanup: redundant casts 2015-04-18 00:16:05 +10:00
Bastien Montagne
fa0f936a64 Fix BPlayer (c) 2015-04-17 16:03:14 +02:00
Sergey Sharybin
3a015bb76b Depsgraph: Report total time spent on scene update
Previously was only per-thread timing.
2015-04-17 18:57:13 +05:00
Campbell Barton
15d3d8560d Cleanup: remove unused face normals
also use const
2015-04-17 23:50:23 +10:00
Dalai Felinto
80b4b43727 Code cleanup (for previous commit) 2015-04-17 10:41:31 -03:00
Dalai Felinto
cd729e9a4e Image Editor: Fix passes increase/decrease buttons
This was half-broken even in 2.74 (if you were using compositor), multiview did us the favour of breaking this for all cases (you are welcome).
It is all working now.
2015-04-17 10:38:17 -03:00
Dalai Felinto
479b669693 Fix T44336: Unable to select cycles-specific passes in UV/image editor
This approach gets rid of iuser->pass for good.

Also, I'm commenting out the pass increase/decrease. This was broken
since multiview. I will fix it later (before 2.75), but I didn't want to
get this patch mangled with that fix.

Thanks Sergey Sharybin for the review and feedbacks.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D1232
2015-04-17 09:48:31 -03:00
Campbell Barton
02fba106fa Dyntopo: save 4 bytes per BMLogVert 2015-04-17 18:07:08 +10:00
Campbell Barton
e05f719b8b Dyntopo: avoid redundant lookup on original data 2015-04-17 17:34:14 +10:00
Bastien Montagne
50522cba92 Fix T44411: poll() function of MESH_OT_knife_project was not strict enough.
We need a 3DView region here, not only the 3DView...
2015-04-17 08:09:16 +02:00
Joshua Leung
09f2aa9382 Fix T44412: Crash when trying to paint on a GPencil frame when the frames are out of order 2015-04-17 13:32:57 +12:00
Joshua Leung
582fa5e36e Fix for Grease Pencil and negative frames
While investigating T44412, I noticed some weirdness going on when trying to
draw on frame 0 (i.e. strokes were getting added to frame 1 instead). Clearly,
this seemed like an off-by-one error related to clamping to prevent negative
frames which was also excluding frame 0.

This commit reverts the fixes made for T36831 in:
rBf18f2fbb33d90ecc91e6f3d063cb9f97f217e808

After thinking this over, I think these checks against drawing on negative
frames aren't needed. Even if the current userpref setting doesn't allow
navigating to negative frames, this may not be true for other users that
may work on the same file (in a team environment). Also, negative frame
values can get set via the dopesheet.
2015-04-17 13:02:45 +12:00
Jorge Bernal
4cd37541b0 BGE: Fix for T44374 Crash when collision sensor deactivated
Don't allocate memory for sensor logic brick if it is deactivated
2015-04-17 02:12:57 +02:00
Campbell Barton
afc2f415ab Cleanup: use const for sculpt code 2015-04-17 03:11:26 +10:00
Gaia Clary
bbae0664a3 Added Support for Custom Vertex Normals to Collada exporter 2015-04-16 19:02:26 +02:00
Antony Riakiotakis
a7cae2987d OpenGL does not like line thickness less than 1.0.
Check here is not completely correct either, we should check against
GL_ALIASED_LINE_WIDTH_RANGE and GL_SMOOTH_LINE_WIDTH_RANGE
2015-04-16 18:35:07 +02:00
Joshua Leung
6589d07c8f Action Editor: Preemptive fix for null-pointer dereference
A few weeks ago, I got a random crash while testing som edge cases
(IIRC, it was trying to assign an action with no active object),
which I haven't been able to reproduce since then. This commit though
adds some extra sanity checks here, as a user may try to assign an
action to an animdata block which did not have an action already.
2015-04-17 01:11:56 +12:00
Joshua Leung
0b691563ea Fix T44408: "Rest Length" property in the Stretch To constraint was getting clipped when using Metric Units
Increased the upper bound for the "Rest Length" property to cope with metric
units, especially when large (i.e. > 2 m) distances are involved. It may be
necessary to increase this again in the future, if even larger distances get
used (though it then starts getting a bit difficulty to justify such setups).
2015-04-17 01:11:55 +12:00
Campbell Barton
6603a10331 Cleanup: remove redundant initializers 2015-04-16 22:26:20 +10:00
Antony Riakiotakis
69b33b6ed3 Draw smoke domain in transparent pass. Should composite smoke domains
correctly in scene - with known limitations of blending between
transparent objects.
2015-04-16 13:02:09 +02:00
Campbell Barton
59db8d74b9 RNA: avoid past tense in property names 2015-04-16 16:41:12 +10:00
Campbell Barton
c5a126ee70 Docs: BLI_rand non-obvious behavior 2015-04-16 16:14:30 +10:00
Jorge Bernal
8c98b1649d BGE: Fix for T42341 Sensor.frequency is badly named
"Frequency" parameter is renamed to "Skip" in the LogicBricks sensors as it represents skipped frames between pulses.

Naming something (frequency) the exact opposite of what it represents (period) was the worst choice.

Also, a new BGE python attribute 'skippedTicks' was introduced. 'frequency' attribute is maintained but deprecated.

Internally, freq variable is used yet at DNA_Sensor to maintain compability and to avoid do_versions.

Thanks to Sybren for the investigation.

{F162440}

Reviewers: campbellbarton, sybren, moguri, hg1

Reviewed By: sybren, hg1

Differential Revision: https://developer.blender.org/D1229
2015-04-16 06:39:33 +02:00
Campbell Barton
b88421aa62 Dyntopo: avoid redundant loop collapsing edges 2015-04-16 12:24:59 +10:00
Campbell Barton
f57b904807 Dyntopo: blend vertex normals when collapsing 2015-04-16 11:59:48 +10:00
Campbell Barton
6675fd6b52 dyntopo: don't allocate tessfaces while sculpting
Tessellation data isn't used for drawing or sculpting.

This frees up some memory ~approx 10% in own tests.
Also slight spee-up since it avoids calculating it in the first place.
2015-04-16 04:32:16 +10:00
Campbell Barton
7f4b6a345e Fix crash loading file without scene in bg mode 2015-04-16 01:45:30 +10:00
Campbell Barton
99299da4b5 Cleanup: warnings, ws 2015-04-16 01:12:22 +10:00
Campbell Barton
34c1319d06 Cleanup: use const for event->tablet_data 2015-04-16 01:07:54 +10:00
Campbell Barton
f660085e2f Increase max brush size from 200 to 500 2015-04-16 00:59:43 +10:00
Porteries Tristan
7730391d74 BGE: subclass with more than 1 argument, D1237
In the BGE you can't create a subclass with more than 1 argument like : "player = Player(owner, 10)"
I have modified the py_base_new to check only the first argument of args tuple.
Now we can do :

    class Player(types.KX_GameObject):
        def __init__(self, gameobj, life):
            print("create new player :", self, ", life :", life)

    player = Player(own, 50)
2015-04-15 22:02:16 +10:00
Campbell Barton
b9ea6fbb30 BMesh: dyntopo used lopsided normals
Normals from subdivided edges were only taken from the edges first vertex.

Interpolate between the two to give more even results.
2015-04-15 20:56:59 +10:00
Campbell Barton
240c5704e4 BMesh: Missed normal from example /w skip-cd flag
We may still want to use the normal as a reference but skip customdata.
2015-04-15 20:56:11 +10:00
Bastien Montagne
255fb79ff3 Fix T44395: String untranslated in open file window. 2015-04-15 11:11:22 +02:00
Campbell Barton
730684f976 BMesh: avoid ghash lookups splitting the pbvh
This isn't a bottleneck but may as well avoid the extra ghash overhead.
2015-04-15 16:14:27 +10:00
Campbell Barton
9a711f98a7 typo in last commit 2015-04-15 15:34:06 +10:00
Campbell Barton
356ceded27 Sculpt: change behavior of crease brush
Pinch would give a flat result on either side of the stroke,
because points were dragged towards a single point.

Now pinch is projected on the sculpt plane, which gives a tighter crease.
The reverse is true too - blob brush which shares the code is also more curved.
2015-04-15 15:27:27 +10:00
Campbell Barton
b216f7abd6 RNA: use lock_ prefix for booleans 2015-04-15 14:51:17 +10:00
Julian Eisel
9b9978656d Fix T44389: Tooltips swapped in Logic Editor 2015-04-14 17:24:55 +02:00
Dalai Felinto
2d33057c75 Multiview: compositor openexr multiview images fully working
This is from my original missing-bits/TODO list.
Basically multiview openexr was only working when multiview was on.
2015-04-14 12:19:11 -03:00
Dalai Felinto
66e2fc39ce Fix T44343 Compositor image node cannot properly load multilayer EXRs 2015-04-14 11:21:01 -03:00
Mai Lavelle
f1355d0b45 Second round of hair random rotation limited to 180 degrees
This time roll back to originally discussed in the code review page approach
with simply bumping UI range for the property.

It's still not totally free from forward compatibility breaking (which is
already broken comparing to previous release) but at least it'll keep files
working inbetween of git blender versions in cases random factor was not
set above 2.0.

Differential Revision: https://developer.blender.org/D1214
2015-04-14 19:04:12 +05:00
Joshua Leung
f1e1ec2d8d Action Editor: Make the warning on unlinking actions a bit less intrusive
venomgfx was complaining that having it do the popup everytime was too intrusive,
so demoting it to just showing the warning in the header.
2015-04-15 01:19:38 +12:00
Antony Riakiotakis
04daaee0fd Fix T44385 SSAO inverted with new Intel drivers.
Intel has decided to fix this for newer devices and drivers only, so we
can't really avoid keeping a list of buggy drivers here.
2015-04-14 12:31:23 +02:00
Antony Riakiotakis
ed40d5eaa7 Add flag that prevents editing of markers. Can be located in marker
menu.

When active, all editing operators for markers will not fire up.
2015-04-14 12:12:17 +02:00
Campbell Barton
68eeeea57e Dyntopo queue added the same edges multiple times
Use tagging to avoid re-evaluating the same edges while sculpting.

While gives only minor speedup,
it allows for changes to the queue without additional redundant checks.
2015-04-14 18:56:49 +10:00
Campbell Barton
7daa921359 BMesh: avoid customdata copy for new dyntopo verts 2015-04-14 18:41:01 +10:00
Campbell Barton
d36429b930 initialize members in-order 2015-04-14 18:41:01 +10:00
Sergey Sharybin
825b015e92 Fix T44348: Blender crashes when selecting bone from inactive scene in outliner
Pose is not guaranteed to be existing in object, so can't be used for selection
flag clear. Use bones themselves for that.
2015-04-14 13:25:25 +05:00
Campbell Barton
8486ee39bd PBVH: use realloc/recalloc 2015-04-14 17:58:07 +10:00
Joshua Leung
34d4ad326c Animation Editors: Name filter now updates as you type, making it a true "live search" 2015-04-14 18:50:15 +12:00
Joshua Leung
1e488802dc NLA: The "filter by name" functionality now works with NLA strips too 2015-04-14 18:39:09 +12:00
Joshua Leung
bb1bc7ecda NLA: Store track that the strip being tweaked comes from
There should be no functional changes visible from this change, but this commit
should make it easier to code tools which need to check on tweeakmode status,
by making it easier to figure out which NLA Track contains the strip which
owned the action being edited. (The strip is already saved, so this commit just
adds the track alongside it).

For now there is no version patch for this. The worst that happens is that an
extra refresh is needed in the NLA editor to get these to show up.
2015-04-14 18:39:07 +12:00