Animation: Add "Frame Channel" operators #104523

Merged
Christoph Lendenfeld merged 27 commits from ChrisLend/blender:frame-channel-operator into main 2023-02-17 18:11:10 +01:00
5 changed files with 332 additions and 726 deletions
Showing only changes of commit 2c76bc5410 - Show all commits

File diff suppressed because it is too large Load Diff

View File

@ -616,15 +616,13 @@ ccl_device_forceinline Spectrum mnee_eval_bsdf_contribution(ccl_private ShaderCl
float alpha2 = bsdf->alpha_x * bsdf->alpha_y;
float cosThetaM = dot(bsdf->N, Ht);
/* Now calculate G1(i, m) and G1(o, m). */
float G;
if (bsdf->type == CLOSURE_BSDF_MICROFACET_BECKMANN_REFRACTION_ID) {
/* Eq. 26, 27: now calculate G1(i,m) and G1(o,m). */
G = bsdf_beckmann_G1(bsdf->alpha_x, cosNI) * bsdf_beckmann_G1(bsdf->alpha_x, cosNO);
G = bsdf_G<true>(alpha2, cosNI, cosNO);
}
else { /* bsdf->type == CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID assumed */
/* Eq. 34: now calculate G1(i,m) and G1(o,m). */
G = (2.f / (1.f + safe_sqrtf(1.f + alpha2 * (1.f - cosNI * cosNI) / (cosNI * cosNI)))) *
(2.f / (1.f + safe_sqrtf(1.f + alpha2 * (1.f - cosNO * cosNO) / (cosNO * cosNO))));
G = bsdf_G<false>(alpha2, cosNI, cosNO);
}
/*

View File

@ -329,13 +329,24 @@ static void unlink_material_fn(bContext * /*C*/,
}
static void unlink_texture_fn(bContext * /*C*/,
ReportList * /*reports*/,
ReportList *reports,
Scene * /*scene*/,
TreeElement *te,
TreeStoreElem *tsep,
TreeStoreElem * /*tselem*/,
TreeStoreElem *tselem,
void * /*user_data*/)
{
if (!tsep || !TSE_IS_REAL_ID(tsep)) {
/* Valid case, no parent element of the texture or it is not an ID (could be a #TSE_ID_BASE
* for example) so there's no data to unlink from. */
BKE_reportf(reports,
RPT_WARNING,
"Cannot unlink texture '%s'. It's not clear which freestyle line style it should "
"be unlinked from, there's no freestyle line style as parent in the Outliner tree",
tselem->id->name + 2);
return;
}
MTex **mtex = nullptr;
int a;
@ -358,7 +369,7 @@ static void unlink_texture_fn(bContext * /*C*/,
}
static void unlink_collection_fn(bContext *C,
ReportList * /*reports*/,
ReportList *reports,
Scene * /*scene*/,
TreeElement * /*te*/,
TreeStoreElem *tsep,
@ -368,6 +379,18 @@ static void unlink_collection_fn(bContext *C,
Main *bmain = CTX_data_main(C);
Collection *collection = (Collection *)tselem->id;
if (!tsep || !TSE_IS_REAL_ID(tsep)) {
/* Valid case, no parent element of the collection or it is not an ID (could be a #TSE_ID_BASE
* for example) so there's no data to unlink from. */
BKE_reportf(reports,
RPT_WARNING,
"Cannot unlink collection '%s'. It's not clear which scene, collection or "
"instance empties it should be unlinked from, there's no scene, collection or "
"instance empties as parent in the Outliner tree",
tselem->id->name + 2);
return;
}
if (tsep) {
if (GS(tsep->id->name) == ID_OB) {
Object *ob = (Object *)tsep->id;
@ -449,13 +472,24 @@ static void unlink_object_fn(bContext *C,
}
static void unlink_world_fn(bContext * /*C*/,
ReportList * /*reports*/,
ReportList *reports,
Scene * /*scene*/,
TreeElement * /*te*/,
TreeStoreElem *tsep,
TreeStoreElem *tselem,
void * /*user_data*/)
{
if (!tsep || !TSE_IS_REAL_ID(tsep)) {
/* Valid case, no parent element of the world or it is not an ID (could be a #TSE_ID_BASE
* for example) so there's no data to unlink from. */
BKE_reportf(reports,
RPT_WARNING,
"Cannot unlink world '%s'. It's not clear which scene it should be unlinked from, "
"there's no scene as parent in the Outliner tree",
tselem->id->name + 2);
return;
}
Scene *parscene = (Scene *)tsep->id;
World *wo = (World *)tselem->id;

View File

@ -44,9 +44,6 @@
#include "MOD_gpencil_ui_common.h"
#include "lineart/MOD_lineart.h"
#include "WM_api.h"
#include "WM_types.h"
static void initData(GpencilModifierData *md)
{
LineartGpencilModifierData *gpmd = (LineartGpencilModifierData *)md;
@ -168,8 +165,6 @@ static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Objec
* cache. */
lmd->cache = gpd->runtime.lineart_cache;
}
WM_main_add_notifier(NA_EDITED | NC_GPENCIL, NULL);
}
static void bakeModifier(Main *UNUSED(bmain),

View File

@ -625,7 +625,7 @@ static PyObject *pygpu_shader_attrs_info_get(BPyGPUShader *self, PyObject *UNUSE
{
uint attr_len = GPU_shader_get_attribute_len(self->shader);
int location_test = 0, attrs_added = 0;
;
PyObject *ret = PyTuple_New(attr_len);
while (attrs_added < attr_len) {
char name[256];