Age | Commit message (Collapse) | Author |
|
Split the depsgraph allocation into a separate function
`BKE_scene_ensure_depsgraph()`. Parameters are only passed to those
functions that actually need them. This removes the the "if that boolean
is `false` this pointer is allowed to be `NULL`" logic and more cleanly
decouples code.
No functional changes.
|
|
|
|
|
|
Functions `mesh_create_eval_final_view()` and
`mesh_create_eval_final_render()` were doing the exact same thing,
except for a hack introduced in d3eb9dddd6b4 (2012-10-08, Better fix for
T32846: dupligroup messes up particle instancing on rendering) that
appears to be no longer necessary. Besides that, these functions had
confusing names. Their functionality changed over time, and whether to
do for-render or for-viewport evaluation is now actually determined by
the depsgraph evaluation mode. This means that the `..._render` function
could evaluate a mesh with viewport settings, and vice versa.
The functions are now merged into `mesh_create_eval_final()`, and the
hack has been removed. The `OB_NO_PSYS_UPDATE` flag has been removed
entirely (instead of keeping it around as deprecated flag), because it
was always only temporarily set on objects during mesh evaluation and
thus not saved to the blend file.
No expected functional changes as far as users are concerned.
|
|
Error in 7341ceb674b2f, this missed moving a local-define when splitting.
|
|
Using a boolean to select between eval/exec behavior wasn't very
readable.
|
|
This commit renames 'execute' to 'run' because:
- This follows Python's "PyRun" which these functions wrap.
- Execution functions can use either exec/eval modes,
making naming awkward (for future API refactoring).
|
|
This was committed as a temporary workaround in 82150f5641364
as release builds were failing (only debug builds worked).
This adds `stdio.h` to the header which is now split into a file that
contains more specialized functionality.
Also move function body inside BPY_python_backtrace,
removing PyC_StackPrint as we have PyC_StackSpit() for
similar functionality that can be called from a debugger.
|
|
Currently BPY_extern.h includes too much mixed functionality.
|
|
|
|
This remove the use of batch->program and replace it with batch->shader.
This will allow GL abstraction latter.
|
|
|
|
|
|
Reviewers: campbellbarton, brecht
Differential Revision: https://developer.blender.org/D8532
|
|
|
|
The problem is caused by a lack of prediction in the `isect_line_segment_tri_v3`
that incorrectly confirms some intersections of coplanar segments to the triangle.
The solution is to use another algorithm to detect intersections.
This also resulted in a slight improvement in the performance:
- 1min 17sec to 1min 6sec in my test file
Differential Revision: https://developer.blender.org/D8500
|
|
Also order sizeof(..) first to promote other values to size_t.
|
|
This addresses warnings from Clang-Tidy's `readability-function-size`
rule in the `source/blender/python` module.
It's just `BPyInit_bgl()` that's been split up into one or two smaller
functions per OpenGL version.
No functional changes.
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/python` module.
No functional changes.
|
|
|
|
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.
This patch has been generated by P1561 followed by `make format`.
Differential Revision: https://developer.blender.org/D8466
|
|
|
|
Issue caused by e9c4325515aed.
|
|
|
|
This helps Python developers troubleshoot errors when
Python causes a crash.
|
|
|
|
|
|
There is a parameter typo in Python API document about bpy.props.StringProperty.
This patch fixes this.
Also this patch should apply to 2.90 branch as well.
Reviewed By: Grische, mont29
Differential Revision: https://developer.blender.org/D8430
|
|
|
|
As creator.c is used for the 'main' function,
avoid obscure declarations being placed so prominently.
- Move Blender as a Python module declarations into it's own section.
- Move USD declaration to an 'extern' just before it's called.
|
|
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
|
|
|
|
|
|
|
|
This removes extern-C blocks around other includes and adds
such blocks for some headers that need them.
|
|
Showing the Python error without any explanation is often
not enough information and doesn't hint that the error was in the
user input.
The error report from a invalid expression such as '..1' used to be:
('invalid syntax', ('<string>', 1, 1, '..1'))
Now reads:
Error evaluating number, see Info editor for details: invalid syntax
Address issue raised by T78913.
|
|
The result of syntax errors read poorly in reports,
resulting in cryptic and unhelpful information.
Change PyC_ExceptionBuffer_Simple only to extract the initial text,
making syntax errors when entering invalid numeric expressions into
buttons easier to follow.
|
|
Remove workaround from 1c806f6bb454dca6f682ecd741bd2fe03b9617bb
as this doesn't seem to be needed anymore.
|
|
|
|
|
|
This hasn't been needed since Python 3.7x.
|
|
Use py_bl_math prefix instead of M_Math.
|
|
Implementation of lerp without a function requires repeating one of
the arguments, which is not ideal. To avoid that, add a new function
to the driver namespace. In addition, provide a function for clamping
between 0 and 1 to support easy clamped lerp, and a smoothstep function
from GLSL that is somewhat related.
The function implementations are added to a new bl_math module.
As an aside, add the round function and two-argument log to the
pylike expression subset.
Differential Revision: https://developer.blender.org/D8205
|
|
Custom driver functions need access to the dependency graph that is
triggering the evaluation of the driver. This patch passes the
dependency graph pointer through all the animation-related calls.
Instead of passing the evaluation time to functions, the code now passes
an `AnimationEvalContext` pointer:
```
typedef struct AnimationEvalContext {
struct Depsgraph *const depsgraph;
const float eval_time;
} AnimationEvalContext;
```
These structs are read-only, meaning that the code cannot change the
evaluation time. Note that the `depsgraph` pointer itself is const, but
it points to a non-const depsgraph.
FCurves and Drivers can be evaluated at a different time than the
current scene time, for example when evaluating NLA strips. This means
that, even though the current time is stored in the dependency graph, we
need an explicit evaluation time.
There are two functions that allow creation of `AnimationEvalContext`
objects:
- `BKE_animsys_eval_context_construct(Depsgraph *depsgraph, float
eval_time)`, which creates a new context object from scratch, and
- `BKE_animsys_eval_context_construct_at(AnimationEvalContext
*anim_eval_context, float eval_time)`, which can be used to create a
`AnimationEvalContext` with the same depsgraph, but at a different
time. This makes it possible to later add fields without changing any
of the code that just want to change the eval time.
This also provides a fix for T75553, although it does require a change
to the custom driver function. The driver should call
`custom_function(depsgraph)`, and the function should use that depsgraph
instead of information from `bpy.context`.
Reviewed By: brecht, sergey
Differential Revision: https://developer.blender.org/D8047
|
|
|
|
This was disabled during 2.8x for smooth porting of 2.7x scripts,
Now '@' is used for matrix multiplication,
support '*' to multiple vector elements.
See T56276.
|
|
Code is mature enough now to not need this anymore, people who do not
want to use liboverrides can just not create them.
|
|
Clang Tidy reported a couple of false positives. I disabled
those `NOLINTNEXTLINE`.
Differential Revision: https://developer.blender.org/D8199
|
|
Time will tell whether we need to expose more RNA override flags here.
Implements/Fix T78534.
Differential Revision: https://developer.blender.org/D8250
|
|
|