forked from bartvdbraak/blender
Cleanup: style, duplicate includes
This commit is contained in:
parent
37b457221e
commit
adfbf276a1
@ -188,7 +188,7 @@ void BKE_scene_multiview_videos_dimensions_get(const struct RenderData *r
|
|||||||
int BKE_scene_multiview_num_videos_get(const struct RenderData *rd);
|
int BKE_scene_multiview_num_videos_get(const struct RenderData *rd);
|
||||||
|
|
||||||
/* depsgraph */
|
/* depsgraph */
|
||||||
struct Depsgraph* BKE_scene_get_depsgraph(struct Scene *scene, struct SceneLayer *scene_layer);
|
struct Depsgraph *BKE_scene_get_depsgraph(struct Scene *scene, struct SceneLayer *scene_layer);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -1344,7 +1344,7 @@ const CustomDataMask CD_MASK_BMESH =
|
|||||||
CD_MASK_PROP_STR | CD_MASK_SHAPEKEY | CD_MASK_SHAPE_KEYINDEX | CD_MASK_MDISPS |
|
CD_MASK_PROP_STR | CD_MASK_SHAPEKEY | CD_MASK_SHAPE_KEYINDEX | CD_MASK_MDISPS |
|
||||||
CD_MASK_CREASE | CD_MASK_BWEIGHT | CD_MASK_RECAST | CD_MASK_PAINT_MASK |
|
CD_MASK_CREASE | CD_MASK_BWEIGHT | CD_MASK_RECAST | CD_MASK_PAINT_MASK |
|
||||||
CD_MASK_GRID_PAINT_MASK | CD_MASK_MVERT_SKIN | CD_MASK_FREESTYLE_EDGE | CD_MASK_FREESTYLE_FACE |
|
CD_MASK_GRID_PAINT_MASK | CD_MASK_MVERT_SKIN | CD_MASK_FREESTYLE_EDGE | CD_MASK_FREESTYLE_FACE |
|
||||||
CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_FACEMAP;
|
CD_MASK_CUSTOMLOOPNORMAL | CD_MASK_FACEMAP;
|
||||||
/**
|
/**
|
||||||
* cover values copied by #BKE_mesh_loops_to_tessdata
|
* cover values copied by #BKE_mesh_loops_to_tessdata
|
||||||
*/
|
*/
|
||||||
|
@ -301,11 +301,14 @@ void BKE_editmesh_loop_tangent_calc(
|
|||||||
&calc_act, &calc_ren, &act_uv_n, &ren_uv_n, act_uv_name, ren_uv_name, &tangent_mask);
|
&calc_act, &calc_ren, &act_uv_n, &ren_uv_n, act_uv_name, ren_uv_name, &tangent_mask);
|
||||||
|
|
||||||
if ((tangent_mask_curr | tangent_mask) != tangent_mask_curr) {
|
if ((tangent_mask_curr | tangent_mask) != tangent_mask_curr) {
|
||||||
for (int i = 0; i < tangent_names_len; i++)
|
for (int i = 0; i < tangent_names_len; i++) {
|
||||||
if (tangent_names[i][0])
|
if (tangent_names[i][0]) {
|
||||||
BKE_mesh_add_loop_tangent_named_layer_for_uv(&bm->ldata, loopdata_out, (int)loopdata_out_len, tangent_names[i]);
|
BKE_mesh_add_loop_tangent_named_layer_for_uv(
|
||||||
|
&bm->ldata, loopdata_out, (int)loopdata_out_len, tangent_names[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
if ((tangent_mask & DM_TANGENT_MASK_ORCO) && CustomData_get_named_layer_index(loopdata_out, CD_TANGENT, "") == -1)
|
if ((tangent_mask & DM_TANGENT_MASK_ORCO) && CustomData_get_named_layer_index(loopdata_out, CD_TANGENT, "") == -1)
|
||||||
CustomData_add_layer_named(loopdata_out, CD_TANGENT, CD_CALLOC, NULL, (int)loopdata_out_len, "");
|
CustomData_add_layer_named(loopdata_out, CD_TANGENT, CD_CALLOC, NULL, (int)loopdata_out_len, "");
|
||||||
if (calc_act && act_uv_name[0])
|
if (calc_act && act_uv_name[0])
|
||||||
BKE_mesh_add_loop_tangent_named_layer_for_uv(&bm->ldata, loopdata_out, (int)loopdata_out_len, act_uv_name);
|
BKE_mesh_add_loop_tangent_named_layer_for_uv(&bm->ldata, loopdata_out, (int)loopdata_out_len, act_uv_name);
|
||||||
if (calc_ren && ren_uv_name[0])
|
if (calc_ren && ren_uv_name[0])
|
||||||
|
@ -1420,7 +1420,7 @@ void BKE_collection_engine_property_add_float_array(
|
|||||||
val.array.len = array_length;
|
val.array.len = array_length;
|
||||||
val.array.type = IDP_FLOAT;
|
val.array.type = IDP_FLOAT;
|
||||||
|
|
||||||
IDProperty *idprop= IDP_New(IDP_ARRAY, &val, name);
|
IDProperty *idprop = IDP_New(IDP_ARRAY, &val, name);
|
||||||
memcpy(IDP_Array(idprop), values, sizeof(float) * idprop->len);
|
memcpy(IDP_Array(idprop), values, sizeof(float) * idprop->len);
|
||||||
IDP_AddToGroup(props, idprop);
|
IDP_AddToGroup(props, idprop);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file blender/blenkernel/intern/probe.c
|
/** \file blender/blenkernel/intern/lightprobe.c
|
||||||
* \ingroup bke
|
* \ingroup bke
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -230,8 +230,6 @@ typedef struct {
|
|||||||
} SGLSLMeshToTangent;
|
} SGLSLMeshToTangent;
|
||||||
|
|
||||||
/* interface */
|
/* interface */
|
||||||
#include "mikktspace.h"
|
|
||||||
|
|
||||||
static int dm_ts_GetNumFaces(const SMikkTSpaceContext *pContext)
|
static int dm_ts_GetNumFaces(const SMikkTSpaceContext *pContext)
|
||||||
{
|
{
|
||||||
SGLSLMeshToTangent *pMesh = pContext->m_pUserData;
|
SGLSLMeshToTangent *pMesh = pContext->m_pUserData;
|
||||||
|
@ -169,7 +169,8 @@ static void scene_collection_copy(SceneCollection *sc_dst, SceneCollection *sc_s
|
|||||||
BLI_duplicatelist(&sc_dst->scene_collections, &sc_src->scene_collections);
|
BLI_duplicatelist(&sc_dst->scene_collections, &sc_src->scene_collections);
|
||||||
for (SceneCollection *nsc_src = sc_src->scene_collections.first, *nsc_dst = sc_dst->scene_collections.first;
|
for (SceneCollection *nsc_src = sc_src->scene_collections.first, *nsc_dst = sc_dst->scene_collections.first;
|
||||||
nsc_src;
|
nsc_src;
|
||||||
nsc_src = nsc_src->next, nsc_dst = nsc_dst->next) {
|
nsc_src = nsc_src->next, nsc_dst = nsc_dst->next)
|
||||||
|
{
|
||||||
scene_collection_copy(nsc_dst, nsc_src, flag);
|
scene_collection_copy(nsc_dst, nsc_src, flag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2330,7 +2331,7 @@ int BKE_scene_multiview_num_videos_get(const RenderData *rd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Depsgraph* BKE_scene_get_depsgraph(Scene *scene, SceneLayer *scene_layer)
|
Depsgraph *BKE_scene_get_depsgraph(Scene *scene, SceneLayer *scene_layer)
|
||||||
{
|
{
|
||||||
(void) scene_layer;
|
(void) scene_layer;
|
||||||
return scene->depsgraph_legacy;
|
return scene->depsgraph_legacy;
|
||||||
|
@ -117,11 +117,11 @@ static void *workspace_relation_get_data_matching_parent(
|
|||||||
* Hence, this should only be used as assert check before assigining a screen to a workspace.
|
* Hence, this should only be used as assert check before assigining a screen to a workspace.
|
||||||
*/
|
*/
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
static bool workspaces_is_screen_used(
|
static bool workspaces_is_screen_used
|
||||||
#else
|
#else
|
||||||
static bool UNUSED_FUNCTION(workspaces_is_screen_used)(
|
static bool UNUSED_FUNCTION(workspaces_is_screen_used)
|
||||||
#endif
|
#endif
|
||||||
const Main *bmain, bScreen *screen)
|
(const Main *bmain, bScreen *screen)
|
||||||
{
|
{
|
||||||
for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) {
|
for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) {
|
||||||
if (workspace_layout_find_exec(workspace, screen)) {
|
if (workspace_layout_find_exec(workspace, screen)) {
|
||||||
|
@ -195,7 +195,7 @@ void normalize_m3_m3(float R[3][3], const float A[3][3]) ATTR_NONNULL();
|
|||||||
void normalize_m4_ex(float R[4][4], float r_scale[3]) ATTR_NONNULL();
|
void normalize_m4_ex(float R[4][4], float r_scale[3]) ATTR_NONNULL();
|
||||||
void normalize_m4(float R[4][4]) ATTR_NONNULL();
|
void normalize_m4(float R[4][4]) ATTR_NONNULL();
|
||||||
void normalize_m4_m4_ex(float R[4][4], const float A[4][4], float r_scale[3]) ATTR_NONNULL();
|
void normalize_m4_m4_ex(float R[4][4], const float A[4][4], float r_scale[3]) ATTR_NONNULL();
|
||||||
void normalize_m4_m4(float R[4][4],const float A[4][4]) ATTR_NONNULL();
|
void normalize_m4_m4(float R[4][4], const float A[4][4]) ATTR_NONNULL();
|
||||||
|
|
||||||
void orthogonalize_m3(float R[3][3], int axis);
|
void orthogonalize_m3(float R[3][3], int axis);
|
||||||
void orthogonalize_m4(float R[4][4], int axis);
|
void orthogonalize_m4(float R[4][4], int axis);
|
||||||
|
@ -377,13 +377,13 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!MAIN_VERSION_ATLEAST(main, 280, 1)) {
|
if (!MAIN_VERSION_ATLEAST(main, 280, 1)) {
|
||||||
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "bleedexp")) {
|
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "bleedexp")) {
|
||||||
for (Lamp *la = main->lamp.first; la; la = la->id.next) {
|
for (Lamp *la = main->lamp.first; la; la = la->id.next) {
|
||||||
la->bleedexp = 120.0f;
|
la->bleedexp = 120.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DNA_struct_elem_find(fd->filesdna, "GPUDOFSettings", "float", "ratio")) {
|
if (!DNA_struct_elem_find(fd->filesdna, "GPUDOFSettings", "float", "ratio")) {
|
||||||
for (Camera *ca = main->camera.first; ca; ca = ca->id.next) {
|
for (Camera *ca = main->camera.first; ca; ca = ca->id.next) {
|
||||||
ca->gpu_dof.ratio = 1.0f;
|
ca->gpu_dof.ratio = 1.0f;
|
||||||
}
|
}
|
||||||
@ -433,7 +433,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "cascade_max_dist")) {
|
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "cascade_max_dist")) {
|
||||||
for (Lamp *la = main->lamp.first; la; la = la->id.next) {
|
for (Lamp *la = main->lamp.first; la; la = la->id.next) {
|
||||||
la->cascade_max_dist = 1000.0f;
|
la->cascade_max_dist = 1000.0f;
|
||||||
la->cascade_count = 4;
|
la->cascade_count = 4;
|
||||||
@ -442,7 +442,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "contact_dist")) {
|
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "contact_dist")) {
|
||||||
for (Lamp *la = main->lamp.first; la; la = la->id.next) {
|
for (Lamp *la = main->lamp.first; la; la = la->id.next) {
|
||||||
la->contact_dist = 1.0f;
|
la->contact_dist = 1.0f;
|
||||||
la->contact_bias = 0.03f;
|
la->contact_bias = 0.03f;
|
||||||
@ -470,7 +470,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
|
|||||||
if (ntree->type == NTREE_SHADER) {
|
if (ntree->type == NTREE_SHADER) {
|
||||||
for (bNode *node = ntree->nodes.first; node; node = node->next) {
|
for (bNode *node = ntree->nodes.first; node; node = node->next) {
|
||||||
if (node->type == 194 /* SH_NODE_EEVEE_METALLIC */ &&
|
if (node->type == 194 /* SH_NODE_EEVEE_METALLIC */ &&
|
||||||
STREQ(node->idname, "ShaderNodeOutputMetallic"))
|
STREQ(node->idname, "ShaderNodeOutputMetallic"))
|
||||||
{
|
{
|
||||||
BLI_strncpy(node->idname, "ShaderNodeEeveeMetallic", sizeof(node->idname));
|
BLI_strncpy(node->idname, "ShaderNodeEeveeMetallic", sizeof(node->idname));
|
||||||
error |= NTREE_DOVERSION_NEED_OUTPUT;
|
error |= NTREE_DOVERSION_NEED_OUTPUT;
|
||||||
@ -482,14 +482,14 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (node->type == 196 /* SH_NODE_OUTPUT_EEVEE_MATERIAL */ &&
|
else if (node->type == 196 /* SH_NODE_OUTPUT_EEVEE_MATERIAL */ &&
|
||||||
STREQ(node->idname, "ShaderNodeOutputEeveeMaterial"))
|
STREQ(node->idname, "ShaderNodeOutputEeveeMaterial"))
|
||||||
{
|
{
|
||||||
node->type = SH_NODE_OUTPUT_MATERIAL;
|
node->type = SH_NODE_OUTPUT_MATERIAL;
|
||||||
BLI_strncpy(node->idname, "ShaderNodeOutputMaterial", sizeof(node->idname));
|
BLI_strncpy(node->idname, "ShaderNodeOutputMaterial", sizeof(node->idname));
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (node->type == 194 /* SH_NODE_EEVEE_METALLIC */ &&
|
else if (node->type == 194 /* SH_NODE_EEVEE_METALLIC */ &&
|
||||||
STREQ(node->idname, "ShaderNodeEeveeMetallic"))
|
STREQ(node->idname, "ShaderNodeEeveeMetallic"))
|
||||||
{
|
{
|
||||||
node->type = SH_NODE_BSDF_PRINCIPLED;
|
node->type = SH_NODE_BSDF_PRINCIPLED;
|
||||||
BLI_strncpy(node->idname, "ShaderNodeBsdfPrincipled", sizeof(node->idname));
|
BLI_strncpy(node->idname, "ShaderNodeBsdfPrincipled", sizeof(node->idname));
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc
|
/** \file blender/depsgraph/intern/builder/deg_builder_nodes_layer.cc
|
||||||
* \ingroup depsgraph
|
* \ingroup depsgraph
|
||||||
*
|
*
|
||||||
* Methods for constructing depsgraph's nodes
|
* Methods for constructing depsgraph's nodes
|
||||||
|
@ -1413,7 +1413,8 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob)
|
|||||||
}
|
}
|
||||||
else if ((psys->flag & PSYS_HAIR_DYNAMICS) &&
|
else if ((psys->flag & PSYS_HAIR_DYNAMICS) &&
|
||||||
psys->clmd != NULL &&
|
psys->clmd != NULL &&
|
||||||
psys->clmd->coll_parms != NULL) {
|
psys->clmd->coll_parms != NULL)
|
||||||
|
{
|
||||||
add_collision_relations(psys_key,
|
add_collision_relations(psys_key,
|
||||||
scene,
|
scene,
|
||||||
ob,
|
ob,
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
|
/** \file blender/depsgraph/intern/builder/deg_builder_relations_layer.cc
|
||||||
* \ingroup depsgraph
|
* \ingroup depsgraph
|
||||||
*
|
*
|
||||||
* Methods for constructing depsgraph
|
* Methods for constructing depsgraph
|
||||||
|
@ -88,7 +88,7 @@ static const int deg_debug_node_type_color_map[][2] = {
|
|||||||
{DEG_NODE_TYPE_GEOMETRY, 6},
|
{DEG_NODE_TYPE_GEOMETRY, 6},
|
||||||
{DEG_NODE_TYPE_SEQUENCER, 7},
|
{DEG_NODE_TYPE_SEQUENCER, 7},
|
||||||
{DEG_NODE_TYPE_SHADING, 8},
|
{DEG_NODE_TYPE_SHADING, 8},
|
||||||
{DEG_NODE_TYPE_SHADING_PARAMETERS,9},
|
{DEG_NODE_TYPE_SHADING_PARAMETERS, 9},
|
||||||
{DEG_NODE_TYPE_CACHE, 10},
|
{DEG_NODE_TYPE_CACHE, 10},
|
||||||
{DEG_NODE_TYPE_LAYER_COLLECTIONS, 11},
|
{DEG_NODE_TYPE_LAYER_COLLECTIONS, 11},
|
||||||
{DEG_NODE_TYPE_COPY_ON_WRITE, 12},
|
{DEG_NODE_TYPE_COPY_ON_WRITE, 12},
|
||||||
|
@ -296,7 +296,8 @@ IDDepsNode *Depsgraph::add_id_node(ID *id, bool do_tag, ID *id_cow_hint)
|
|||||||
* referencing to.
|
* referencing to.
|
||||||
*/
|
*/
|
||||||
BLI_ghash_insert(id_hash, id, id_node);
|
BLI_ghash_insert(id_hash, id, id_node);
|
||||||
} else if (do_tag) {
|
}
|
||||||
|
else if (do_tag) {
|
||||||
id->tag |= LIB_TAG_DOIT;
|
id->tag |= LIB_TAG_DOIT;
|
||||||
}
|
}
|
||||||
return id_node;
|
return id_node;
|
||||||
|
@ -225,9 +225,8 @@ void DEG_objects_iterator_next(BLI_Iterator *iter)
|
|||||||
BLI_assert(!BLI_listbase_is_empty(&base->collection_properties->data.group));
|
BLI_assert(!BLI_listbase_is_empty(&base->collection_properties->data.group));
|
||||||
|
|
||||||
/* Flushing depsgraph data. */
|
/* Flushing depsgraph data. */
|
||||||
deg_flush_base_flags_and_settings(ob,
|
deg_flush_base_flags_and_settings(
|
||||||
base,
|
ob, base, data->base_flag);
|
||||||
data->base_flag);
|
|
||||||
|
|
||||||
if ((data->flag & DEG_OBJECT_ITER_FLAG_DUPLI) && (ob->transflag & OB_DUPLI)) {
|
if ((data->flag & DEG_OBJECT_ITER_FLAG_DUPLI) && (ob->transflag & OB_DUPLI)) {
|
||||||
data->dupli_parent = ob;
|
data->dupli_parent = ob;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/** \file blender/depsgraph/intern/eval/deg_eval_copy_on_write.h
|
/** \file blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
|
||||||
* \ingroup depsgraph
|
* \ingroup depsgraph
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -65,9 +65,7 @@ extern "C" {
|
|||||||
# include "DNA_lamp_types.h"
|
# include "DNA_lamp_types.h"
|
||||||
# include "DNA_linestyle_types.h"
|
# include "DNA_linestyle_types.h"
|
||||||
# include "DNA_material_types.h"
|
# include "DNA_material_types.h"
|
||||||
# include "DNA_mesh_types.h"
|
|
||||||
# include "DNA_node_types.h"
|
# include "DNA_node_types.h"
|
||||||
# include "DNA_scene_types.h"
|
|
||||||
# include "DNA_texture_types.h"
|
# include "DNA_texture_types.h"
|
||||||
# include "DNA_world_types.h"
|
# include "DNA_world_types.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file basic_engine.h
|
/** \file basic_engine.c
|
||||||
* \ingroup draw_engine
|
* \ingroup draw_engine
|
||||||
*
|
*
|
||||||
* Simple engine for drawing color and/or depth.
|
* Simple engine for drawing color and/or depth.
|
||||||
|
@ -1189,7 +1189,7 @@ void EEVEE_effects_cache_init(EEVEE_SceneLayerData *sldata, EEVEE_Data *vedata)
|
|||||||
/* This create an empty batch of N triangles to be positioned
|
/* This create an empty batch of N triangles to be positioned
|
||||||
* by the vertex shader 0.4ms against 6ms with instancing */
|
* by the vertex shader 0.4ms against 6ms with instancing */
|
||||||
const float *viewport_size = DRW_viewport_size_get();
|
const float *viewport_size = DRW_viewport_size_get();
|
||||||
const int sprite_ct = ((int)viewport_size[0]/2) * ((int)viewport_size[1]/2); /* brackets matters */
|
const int sprite_ct = ((int)viewport_size[0] / 2) * ((int)viewport_size[1] / 2); /* brackets matters */
|
||||||
grp = DRW_shgroup_empty_tri_batch_create(e_data.dof_scatter_sh, psl->dof_scatter, sprite_ct);
|
grp = DRW_shgroup_empty_tri_batch_create(e_data.dof_scatter_sh, psl->dof_scatter, sprite_ct);
|
||||||
|
|
||||||
DRW_shgroup_uniform_buffer(grp, "colorBuffer", &effects->unf_source_buffer);
|
DRW_shgroup_uniform_buffer(grp, "colorBuffer", &effects->unf_source_buffer);
|
||||||
@ -1577,7 +1577,7 @@ void EEVEE_draw_effects(EEVEE_Data *vedata)
|
|||||||
last = txl->bloom_downsample[0];
|
last = txl->bloom_downsample[0];
|
||||||
|
|
||||||
for (int i = 1; i < effects->bloom_iteration_ct; ++i) {
|
for (int i = 1; i < effects->bloom_iteration_ct; ++i) {
|
||||||
copy_v2_v2(effects->unf_source_texel_size, effects->downsamp_texel_size[i-1]);
|
copy_v2_v2(effects->unf_source_texel_size, effects->downsamp_texel_size[i - 1]);
|
||||||
effects->unf_source_buffer = last;
|
effects->unf_source_buffer = last;
|
||||||
|
|
||||||
DRW_framebuffer_bind(fbl->bloom_down_fb[i]);
|
DRW_framebuffer_bind(fbl->bloom_down_fb[i]);
|
||||||
@ -1646,8 +1646,8 @@ void EEVEE_draw_effects(EEVEE_Data *vedata)
|
|||||||
SWAP_DOUBLE_BUFFERS();
|
SWAP_DOUBLE_BUFFERS();
|
||||||
|
|
||||||
if (!stl->g_data->valid_double_buffer &&
|
if (!stl->g_data->valid_double_buffer &&
|
||||||
((effects->enabled_effects & EFFECT_DOUBLE_BUFFER) != 0) &&
|
((effects->enabled_effects & EFFECT_DOUBLE_BUFFER) != 0) &&
|
||||||
(DRW_state_is_image_render() == false))
|
(DRW_state_is_image_render() == false))
|
||||||
{
|
{
|
||||||
/* If history buffer is not valid request another frame.
|
/* If history buffer is not valid request another frame.
|
||||||
* This fix black reflections on area resize. */
|
* This fix black reflections on area resize. */
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file eevee_lights.c
|
/** \file eevee_lightprobes.c
|
||||||
* \ingroup DNA
|
* \ingroup DNA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -36,8 +36,6 @@
|
|||||||
|
|
||||||
#include "ED_screen.h"
|
#include "ED_screen.h"
|
||||||
|
|
||||||
#include "DRW_render.h"
|
|
||||||
|
|
||||||
#include "GPU_material.h"
|
#include "GPU_material.h"
|
||||||
#include "GPU_texture.h"
|
#include "GPU_texture.h"
|
||||||
#include "GPU_glew.h"
|
#include "GPU_glew.h"
|
||||||
@ -473,7 +471,7 @@ void EEVEE_lightprobes_cache_add(EEVEE_SceneLayerData *sldata, Object *ob)
|
|||||||
|
|
||||||
/* Step 1 find all lamps in the scene and setup them */
|
/* Step 1 find all lamps in the scene and setup them */
|
||||||
if ((probe->type == LIGHTPROBE_TYPE_CUBE && pinfo->num_cube >= MAX_PROBE) ||
|
if ((probe->type == LIGHTPROBE_TYPE_CUBE && pinfo->num_cube >= MAX_PROBE) ||
|
||||||
(probe->type == LIGHTPROBE_TYPE_GRID && pinfo->num_grid >= MAX_PROBE))
|
(probe->type == LIGHTPROBE_TYPE_GRID && pinfo->num_grid >= MAX_PROBE))
|
||||||
{
|
{
|
||||||
printf("Too much probes in the scene !!!\n");
|
printf("Too much probes in the scene !!!\n");
|
||||||
return;
|
return;
|
||||||
@ -669,7 +667,7 @@ static void EEVEE_lightprobes_updates(EEVEE_SceneLayerData *sldata, EEVEE_PassLi
|
|||||||
|
|
||||||
/* Debug Display */
|
/* Debug Display */
|
||||||
if (BKE_object_is_visible(ob) &&
|
if (BKE_object_is_visible(ob) &&
|
||||||
DRW_state_draw_support() &&
|
DRW_state_draw_support() &&
|
||||||
(probe->flag & LIGHTPROBE_FLAG_SHOW_DATA))
|
(probe->flag & LIGHTPROBE_FLAG_SHOW_DATA))
|
||||||
{
|
{
|
||||||
ped->probe_size = probe->data_draw_size * 0.1f;
|
ped->probe_size = probe->data_draw_size * 0.1f;
|
||||||
@ -1347,9 +1345,9 @@ void EEVEE_lightprobes_refresh(EEVEE_SceneLayerData *sldata, EEVEE_Data *vedata)
|
|||||||
else if (((((int)grid_loc[0] % current_stride) == 0) &&
|
else if (((((int)grid_loc[0] % current_stride) == 0) &&
|
||||||
(((int)grid_loc[1] % current_stride) == 0) &&
|
(((int)grid_loc[1] % current_stride) == 0) &&
|
||||||
(((int)grid_loc[2] % current_stride) == 0)) &&
|
(((int)grid_loc[2] % current_stride) == 0)) &&
|
||||||
!((((int)grid_loc[0] % prev_stride) == 0) &&
|
!((((int)grid_loc[0] % prev_stride) == 0) &&
|
||||||
(((int)grid_loc[1] % prev_stride) == 0) &&
|
(((int)grid_loc[1] % prev_stride) == 0) &&
|
||||||
(((int)grid_loc[2] % prev_stride) == 0)))
|
(((int)grid_loc[2] % prev_stride) == 0)))
|
||||||
{
|
{
|
||||||
valid_cell = true;
|
valid_cell = true;
|
||||||
}
|
}
|
||||||
|
@ -128,8 +128,8 @@ void EEVEE_lights_init(EEVEE_SceneLayerData *sldata)
|
|||||||
|
|
||||||
EEVEE_LampsInfo *linfo = sldata->lamps;
|
EEVEE_LampsInfo *linfo = sldata->lamps;
|
||||||
if ((linfo->shadow_size != sh_size) ||
|
if ((linfo->shadow_size != sh_size) ||
|
||||||
(linfo->shadow_method != sh_method) ||
|
(linfo->shadow_method != sh_method) ||
|
||||||
(linfo->shadow_high_bitdepth != sh_high_bitdepth))
|
(linfo->shadow_high_bitdepth != sh_high_bitdepth))
|
||||||
{
|
{
|
||||||
BLI_assert((sh_size > 0) && (sh_size <= 8192));
|
BLI_assert((sh_size > 0) && (sh_size <= 8192));
|
||||||
DRW_TEXTURE_FREE_SAFE(sldata->shadow_pool);
|
DRW_TEXTURE_FREE_SAFE(sldata->shadow_pool);
|
||||||
@ -242,7 +242,7 @@ void EEVEE_lights_cache_add(EEVEE_SceneLayerData *sldata, Object *ob)
|
|||||||
MEM_SAFE_FREE(led->storage);
|
MEM_SAFE_FREE(led->storage);
|
||||||
|
|
||||||
if (la->mode & (LA_SHAD_BUF | LA_SHAD_RAY)) {
|
if (la->mode & (LA_SHAD_BUF | LA_SHAD_RAY)) {
|
||||||
if (la->type == LA_SUN) {
|
if (la->type == LA_SUN) {
|
||||||
int sh_nbr = 1; /* TODO : MSM */
|
int sh_nbr = 1; /* TODO : MSM */
|
||||||
int cascade_nbr = MAX_CASCADE_NUM; /* TODO : Custom cascade number */
|
int cascade_nbr = MAX_CASCADE_NUM; /* TODO : Custom cascade number */
|
||||||
|
|
||||||
@ -463,12 +463,12 @@ static void eevee_light_setup(Object *ob, EEVEE_LampsInfo *linfo, EEVEE_LampEngi
|
|||||||
|
|
||||||
/* Make illumination power constant */
|
/* Make illumination power constant */
|
||||||
if (la->type == LA_AREA) {
|
if (la->type == LA_AREA) {
|
||||||
power = 1.0f / (evli->sizex * evli->sizey * 4.0f * M_PI) /* 1/(w*h*Pi) */
|
power = 1.0f / (evli->sizex * evli->sizey * 4.0f * M_PI) * /* 1/(w*h*Pi) */
|
||||||
* 80.0f; /* XXX : Empirical, Fit cycles power */
|
80.0f; /* XXX : Empirical, Fit cycles power */
|
||||||
}
|
}
|
||||||
else if (la->type == LA_SPOT || la->type == LA_LOCAL) {
|
else if (la->type == LA_SPOT || la->type == LA_LOCAL) {
|
||||||
power = 1.0f / (4.0f * evli->radius * evli->radius * M_PI * M_PI) /* 1/(4*r²*Pi²) */
|
power = 1.0f / (4.0f * evli->radius * evli->radius * M_PI * M_PI) * /* 1/(4*r²*Pi²) */
|
||||||
* M_PI * M_PI * M_PI * 10.0; /* XXX : Empirical, Fit cycles power */
|
M_PI * M_PI * M_PI * 10.0; /* XXX : Empirical, Fit cycles power */
|
||||||
|
|
||||||
/* for point lights (a.k.a radius == 0.0) */
|
/* for point lights (a.k.a radius == 0.0) */
|
||||||
// power = M_PI * M_PI * 0.78; /* XXX : Empirical, Fit cycles power */
|
// power = M_PI * M_PI * 0.78; /* XXX : Empirical, Fit cycles power */
|
||||||
@ -525,7 +525,7 @@ static void frustum_min_bounding_sphere(const float corners[8][4], float r_cente
|
|||||||
|
|
||||||
/* compute the bounding box */
|
/* compute the bounding box */
|
||||||
INIT_MINMAX(minvec, maxvec);
|
INIT_MINMAX(minvec, maxvec);
|
||||||
for (int i = 0; i < 8; ++i) {
|
for (int i = 0; i < 8; ++i) {
|
||||||
minmax_v3v3_v3(minvec, maxvec, corners[i]);
|
minmax_v3v3_v3(minvec, maxvec, corners[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -542,7 +542,7 @@ static void frustum_min_bounding_sphere(const float corners[8][4], float r_cente
|
|||||||
/* Search the largest distance between the sphere center
|
/* Search the largest distance between the sphere center
|
||||||
* and the front plane corners. */
|
* and the front plane corners. */
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
float rad = len_v3v3(corners[4+i], r_center);
|
float rad = len_v3v3(corners[4 + i], r_center);
|
||||||
if (rad > *r_radius) {
|
if (rad > *r_radius) {
|
||||||
*r_radius = rad;
|
*r_radius = rad;
|
||||||
}
|
}
|
||||||
@ -648,11 +648,11 @@ static void eevee_shadow_cascade_setup(Object *ob, EEVEE_LampsInfo *linfo, EEVEE
|
|||||||
else {
|
else {
|
||||||
cascade_data->split_start[c] = linear_split;
|
cascade_data->split_start[c] = linear_split;
|
||||||
}
|
}
|
||||||
cascade_data->split_end[c-1] = cascade_data->split_start[c];
|
cascade_data->split_end[c - 1] = cascade_data->split_start[c];
|
||||||
|
|
||||||
/* Add some overlap for smooth transition */
|
/* Add some overlap for smooth transition */
|
||||||
cascade_data->split_start[c] = LERP(la->cascade_fade, cascade_data->split_end[c-1],
|
cascade_data->split_start[c] = LERP(la->cascade_fade, cascade_data->split_end[c - 1],
|
||||||
(c > 1) ? cascade_data->split_end[c-2] : cascade_data->split_start[0]);
|
(c > 1) ? cascade_data->split_end[c - 2] : cascade_data->split_start[0]);
|
||||||
|
|
||||||
/* NDC Space */
|
/* NDC Space */
|
||||||
{
|
{
|
||||||
@ -667,20 +667,20 @@ static void eevee_shadow_cascade_setup(Object *ob, EEVEE_LampsInfo *linfo, EEVEE
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
float p[4] = {1.0f, 1.0f, cascade_data->split_end[c-1], 1.0f};
|
float p[4] = {1.0f, 1.0f, cascade_data->split_end[c - 1], 1.0f};
|
||||||
/* TODO: we don't need full m4 multiply here */
|
/* TODO: we don't need full m4 multiply here */
|
||||||
mul_m4_v4(viewprojmat, p);
|
mul_m4_v4(viewprojmat, p);
|
||||||
splits_end_ndc[c-1] = p[2];
|
splits_end_ndc[c - 1] = p[2];
|
||||||
|
|
||||||
if (is_persp) {
|
if (is_persp) {
|
||||||
splits_end_ndc[c-1] /= p[3];
|
splits_end_ndc[c - 1] /= p[3];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set last cascade split fade distance into the first split_start. */
|
/* Set last cascade split fade distance into the first split_start. */
|
||||||
float prev_split = (cascade_nbr > 1) ? cascade_data->split_end[cascade_nbr-2] : cascade_data->split_start[0];
|
float prev_split = (cascade_nbr > 1) ? cascade_data->split_end[cascade_nbr - 2] : cascade_data->split_start[0];
|
||||||
cascade_data->split_start[0] = LERP(la->cascade_fade, cascade_data->split_end[cascade_nbr-1], prev_split);
|
cascade_data->split_start[0] = LERP(la->cascade_fade, cascade_data->split_end[cascade_nbr - 1], prev_split);
|
||||||
|
|
||||||
/* For each cascade */
|
/* For each cascade */
|
||||||
for (int c = 0; c < cascade_nbr; ++c) {
|
for (int c = 0; c < cascade_nbr; ++c) {
|
||||||
@ -699,7 +699,7 @@ static void eevee_shadow_cascade_setup(Object *ob, EEVEE_LampsInfo *linfo, EEVEE
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Transform them into world space */
|
/* Transform them into world space */
|
||||||
for (int i = 0; i < 8; ++i) {
|
for (int i = 0; i < 8; ++i) {
|
||||||
mul_m4_v4(persinv, corners[i]);
|
mul_m4_v4(persinv, corners[i]);
|
||||||
mul_v3_fl(corners[i], 1.0f / corners[i][3]);
|
mul_v3_fl(corners[i], 1.0f / corners[i][3]);
|
||||||
corners[i][3] = 1.0f;
|
corners[i][3] = 1.0f;
|
||||||
@ -712,7 +712,7 @@ static void eevee_shadow_cascade_setup(Object *ob, EEVEE_LampsInfo *linfo, EEVEE
|
|||||||
normalize_v3(viewmat[1]);
|
normalize_v3(viewmat[1]);
|
||||||
normalize_v3(viewmat[2]);
|
normalize_v3(viewmat[2]);
|
||||||
|
|
||||||
for (int i = 0; i < 8; ++i) {
|
for (int i = 0; i < 8; ++i) {
|
||||||
mul_m4_v4(viewmat, corners[i]);
|
mul_m4_v4(viewmat, corners[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -779,8 +779,8 @@ static bool cube_bbox_intersect(const float cube_center[3], float cube_half_dim,
|
|||||||
minmax_v3v3_v3(min, max, vec);
|
minmax_v3v3_v3(min, max, vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MAX3(max[0], max[1], max[2]) < -cube_half_dim) return false;
|
if (MAX3(max[0], max[1], max[2]) < -cube_half_dim) return false;
|
||||||
if (MIN3(min[0], min[1], min[2]) > cube_half_dim) return false;
|
if (MIN3(min[0], min[1], min[2]) > cube_half_dim) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file eeveee_lut.h
|
/** \file eevee_lut.h
|
||||||
* \ingroup gpu
|
* \ingroup gpu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h)
|
|||||||
|
|
||||||
DRW_framebuffer_read_data(0, 0, w, h, 3, 0, data);
|
DRW_framebuffer_read_data(0, 0, w, h, 3, 0, data);
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
fprintf(f, "\t{\n\t\t");
|
fprintf(f, "\t{\n\t\t");
|
||||||
for (int i = 0; i < w*h * 3; i+=3) {
|
for (int i = 0; i < w*h * 3; i+=3) {
|
||||||
fprintf(f, "%ff,", data[i]);
|
fprintf(f, "%ff,", data[i]);
|
||||||
@ -241,7 +241,7 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h)
|
|||||||
else fprintf(f, " ");
|
else fprintf(f, " ");
|
||||||
}
|
}
|
||||||
fprintf(f, "\n\t},\n");
|
fprintf(f, "\n\t},\n");
|
||||||
#else
|
#else
|
||||||
for (int i = 0; i < w*h * 3; i+=3) {
|
for (int i = 0; i < w*h * 3; i+=3) {
|
||||||
if (data[i] < 0.01) printf(" ");
|
if (data[i] < 0.01) printf(" ");
|
||||||
else if (data[i] < 0.3) printf(".");
|
else if (data[i] < 0.3) printf(".");
|
||||||
@ -250,7 +250,7 @@ static struct GPUTexture *create_ggx_refraction_lut_texture(int w, int h)
|
|||||||
else printf("#");
|
else printf("#");
|
||||||
if ((i/3+1) % 64 == 0) printf("\n");
|
if ((i/3+1) % 64 == 0) printf("\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} while (roughness < 1.0f);
|
} while (roughness < 1.0f);
|
||||||
fprintf(f, "\n};\n");
|
fprintf(f, "\n};\n");
|
||||||
@ -445,8 +445,8 @@ void EEVEE_update_util_texture(float offset)
|
|||||||
/* Copy bsdf_split_sum_ggx into 2nd layer red and green channels.
|
/* Copy bsdf_split_sum_ggx into 2nd layer red and green channels.
|
||||||
Copy ltc_mag_ggx into 2nd layer blue channel. */
|
Copy ltc_mag_ggx into 2nd layer blue channel. */
|
||||||
for (int i = 0; i < 64 * 64; i++) {
|
for (int i = 0; i < 64 * 64; i++) {
|
||||||
texels_layer[i][0] = bsdf_split_sum_ggx[i*2 + 0];
|
texels_layer[i][0] = bsdf_split_sum_ggx[i * 2 + 0];
|
||||||
texels_layer[i][1] = bsdf_split_sum_ggx[i*2 + 1];
|
texels_layer[i][1] = bsdf_split_sum_ggx[i * 2 + 1];
|
||||||
texels_layer[i][2] = ltc_mag_ggx[i];
|
texels_layer[i][2] = ltc_mag_ggx[i];
|
||||||
}
|
}
|
||||||
texels_layer += 64 * 64;
|
texels_layer += 64 * 64;
|
||||||
@ -467,10 +467,10 @@ void EEVEE_update_util_texture(float offset)
|
|||||||
/* Copy Refraction GGX LUT in layer 4 - 20 */
|
/* Copy Refraction GGX LUT in layer 4 - 20 */
|
||||||
for (int j = 0; j < 16; ++j) {
|
for (int j = 0; j < 16; ++j) {
|
||||||
for (int i = 0; i < 64 * 64; i++) {
|
for (int i = 0; i < 64 * 64; i++) {
|
||||||
texels_layer[i][0] = btdf_split_sum_ggx[j*2][i];
|
texels_layer[i][0] = btdf_split_sum_ggx[j * 2][i];
|
||||||
texels_layer[i][1] = btdf_split_sum_ggx[j*2][i];
|
texels_layer[i][1] = btdf_split_sum_ggx[j * 2][i];
|
||||||
texels_layer[i][2] = btdf_split_sum_ggx[j*2][i];
|
texels_layer[i][2] = btdf_split_sum_ggx[j * 2][i];
|
||||||
texels_layer[i][3] = btdf_split_sum_ggx[j*2][i];
|
texels_layer[i][3] = btdf_split_sum_ggx[j * 2][i];
|
||||||
}
|
}
|
||||||
texels_layer += 64 * 64;
|
texels_layer += 64 * 64;
|
||||||
}
|
}
|
||||||
@ -933,7 +933,7 @@ void EEVEE_materials_cache_init(EEVEE_Data *vedata)
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
typedef struct EeveeMaterialShadingGroups{
|
typedef struct EeveeMaterialShadingGroups {
|
||||||
struct DRWShadingGroup *shading_grp;
|
struct DRWShadingGroup *shading_grp;
|
||||||
struct DRWShadingGroup *depth_grp;
|
struct DRWShadingGroup *depth_grp;
|
||||||
struct DRWShadingGroup *depth_clip_grp;
|
struct DRWShadingGroup *depth_clip_grp;
|
||||||
|
@ -159,7 +159,7 @@ typedef struct EEVEE_FramebufferList {
|
|||||||
struct GPUFrameBuffer *effect_fb;
|
struct GPUFrameBuffer *effect_fb;
|
||||||
struct GPUFrameBuffer *bloom_blit_fb;
|
struct GPUFrameBuffer *bloom_blit_fb;
|
||||||
struct GPUFrameBuffer *bloom_down_fb[MAX_BLOOM_STEP];
|
struct GPUFrameBuffer *bloom_down_fb[MAX_BLOOM_STEP];
|
||||||
struct GPUFrameBuffer *bloom_accum_fb[MAX_BLOOM_STEP-1];
|
struct GPUFrameBuffer *bloom_accum_fb[MAX_BLOOM_STEP - 1];
|
||||||
struct GPUFrameBuffer *dof_down_fb;
|
struct GPUFrameBuffer *dof_down_fb;
|
||||||
struct GPUFrameBuffer *dof_scatter_far_fb;
|
struct GPUFrameBuffer *dof_scatter_far_fb;
|
||||||
struct GPUFrameBuffer *dof_scatter_near_fb;
|
struct GPUFrameBuffer *dof_scatter_near_fb;
|
||||||
@ -184,7 +184,7 @@ typedef struct EEVEE_TextureList {
|
|||||||
struct GPUTexture *dof_far_blur; /* R16_G16_B16_A16 */
|
struct GPUTexture *dof_far_blur; /* R16_G16_B16_A16 */
|
||||||
struct GPUTexture *bloom_blit; /* R16_G16_B16 */
|
struct GPUTexture *bloom_blit; /* R16_G16_B16 */
|
||||||
struct GPUTexture *bloom_downsample[MAX_BLOOM_STEP]; /* R16_G16_B16 */
|
struct GPUTexture *bloom_downsample[MAX_BLOOM_STEP]; /* R16_G16_B16 */
|
||||||
struct GPUTexture *bloom_upsample[MAX_BLOOM_STEP-1]; /* R16_G16_B16 */
|
struct GPUTexture *bloom_upsample[MAX_BLOOM_STEP - 1]; /* R16_G16_B16 */
|
||||||
struct GPUTexture *ssr_normal_input;
|
struct GPUTexture *ssr_normal_input;
|
||||||
struct GPUTexture *ssr_specrough_input;
|
struct GPUTexture *ssr_specrough_input;
|
||||||
struct GPUTexture *refract_color;
|
struct GPUTexture *refract_color;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** \file external_engine.h
|
/** \file external_engine.c
|
||||||
* \ingroup draw_engine
|
* \ingroup draw_engine
|
||||||
*
|
*
|
||||||
* Base engine for external render engines.
|
* Base engine for external render engines.
|
||||||
|
@ -250,7 +250,7 @@ Gwn_Batch *DRW_cache_fullscreen_quad_get(void)
|
|||||||
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
GWN_vertbuf_data_alloc(vbo, 3);
|
GWN_vertbuf_data_alloc(vbo, 3);
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]);
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]);
|
GWN_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]);
|
||||||
}
|
}
|
||||||
@ -279,7 +279,7 @@ Gwn_Batch *DRW_cache_quad_get(void)
|
|||||||
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
GWN_vertbuf_data_alloc(vbo, 4);
|
GWN_vertbuf_data_alloc(vbo, 4);
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]);
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]);
|
GWN_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]);
|
||||||
}
|
}
|
||||||
@ -391,7 +391,7 @@ Gwn_Batch *DRW_cache_square_get(void)
|
|||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 2, p[i % 4]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 2, p[i % 4]);
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 2 + 1, p[(i+1) % 4]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, i * 2 + 1, p[(i + 1) % 4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
SHC.drw_square = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
|
SHC.drw_square = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
|
||||||
@ -1196,8 +1196,8 @@ Gwn_Batch *DRW_cache_lamp_spot_get(void)
|
|||||||
|
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.n1, i * 4, n[(i) % NSEGMENTS]);
|
GWN_vertbuf_attr_set(vbo, attr_id.n1, i * 4, n[(i) % NSEGMENTS]);
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.n1, i * 4 + 1, n[(i) % NSEGMENTS]);
|
GWN_vertbuf_attr_set(vbo, attr_id.n1, i * 4 + 1, n[(i) % NSEGMENTS]);
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.n2, i * 4, n[(i+1) % NSEGMENTS]);
|
GWN_vertbuf_attr_set(vbo, attr_id.n2, i * 4, n[(i + 1) % NSEGMENTS]);
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.n2, i * 4 + 1, n[(i+1) % NSEGMENTS]);
|
GWN_vertbuf_attr_set(vbo, attr_id.n2, i * 4 + 1, n[(i + 1) % NSEGMENTS]);
|
||||||
|
|
||||||
/* end ring */
|
/* end ring */
|
||||||
v[0] = cv[0], v[1] = cv[1], v[2] = -1.0f;
|
v[0] = cv[0], v[1] = cv[1], v[2] = -1.0f;
|
||||||
@ -1245,8 +1245,8 @@ Gwn_Batch *DRW_cache_lamp_spot_square_get(void)
|
|||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[0]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[0]);
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[i]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[i]);
|
||||||
|
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[(i % 4)+1]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[(i % 4) + 1]);
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[((i+1) % 4)+1]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[((i + 1) % 4) + 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
SHC.drw_lamp_spot_square = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
|
SHC.drw_lamp_spot_square = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);
|
||||||
@ -1351,7 +1351,7 @@ Gwn_Batch *DRW_cache_lightprobe_cube_get(void)
|
|||||||
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
GWN_vertbuf_data_alloc(vbo, (6 + 3) * 2);
|
GWN_vertbuf_data_alloc(vbo, (6 + 3) * 2);
|
||||||
|
|
||||||
for (int i = 0; i < 6; ++i) {
|
for (int i = 0; i < 6; ++i) {
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]);
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 6]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 6]);
|
||||||
}
|
}
|
||||||
@ -1396,7 +1396,7 @@ Gwn_Batch *DRW_cache_lightprobe_grid_get(void)
|
|||||||
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
GWN_vertbuf_data_alloc(vbo, (6 * 2 + 3) * 2);
|
GWN_vertbuf_data_alloc(vbo, (6 * 2 + 3) * 2);
|
||||||
|
|
||||||
for (int i = 0; i < 6; ++i) {
|
for (int i = 0; i < 6; ++i) {
|
||||||
float tmp_v1[3], tmp_v2[3], tmp_tr[3];
|
float tmp_v1[3], tmp_v2[3], tmp_tr[3];
|
||||||
copy_v3_v3(tmp_v1, v[i]);
|
copy_v3_v3(tmp_v1, v[i]);
|
||||||
copy_v3_v3(tmp_v2, v[(i + 1) % 6]);
|
copy_v3_v3(tmp_v2, v[(i + 1) % 6]);
|
||||||
@ -1449,7 +1449,7 @@ Gwn_Batch *DRW_cache_lightprobe_planar_get(void)
|
|||||||
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
GWN_vertbuf_data_alloc(vbo, 4 * 2);
|
GWN_vertbuf_data_alloc(vbo, 4 * 2);
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]);
|
||||||
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 4]);
|
GWN_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 4]);
|
||||||
}
|
}
|
||||||
@ -1623,7 +1623,7 @@ static const unsigned int bone_box_solid_tris[12][3] = {
|
|||||||
/* aligned with bone_octahedral_solid_tris */
|
/* aligned with bone_octahedral_solid_tris */
|
||||||
static const float bone_box_solid_normals[12][3] = {
|
static const float bone_box_solid_normals[12][3] = {
|
||||||
{ 0.0f, -1.0f, 0.0f},
|
{ 0.0f, -1.0f, 0.0f},
|
||||||
{ 0.0f, -1.0f, 0.0f},
|
{ 0.0f, -1.0f, 0.0f},
|
||||||
|
|
||||||
{ 1.0f, 0.0f, 0.0f},
|
{ 1.0f, 0.0f, 0.0f},
|
||||||
{ 1.0f, 0.0f, 0.0f},
|
{ 1.0f, 0.0f, 0.0f},
|
||||||
@ -1782,10 +1782,10 @@ Gwn_Batch *DRW_cache_bone_envelope_solid_get(void)
|
|||||||
float co1[3], co2[3], co3[3], co4[3];
|
float co1[3], co2[3], co3[3], co4[3];
|
||||||
|
|
||||||
for (int j = 0; j < lat_res; j++, lat += lat_inc) {
|
for (int j = 0; j < lat_res; j++, lat += lat_inc) {
|
||||||
benv_lat_lon_to_co(lat , lon , co1);
|
benv_lat_lon_to_co(lat, lon, co1);
|
||||||
benv_lat_lon_to_co(lat , lon + lon_inc, co2);
|
benv_lat_lon_to_co(lat, lon + lon_inc, co2);
|
||||||
benv_lat_lon_to_co(lat + lat_inc, lon + lon_inc, co3);
|
benv_lat_lon_to_co(lat + lat_inc, lon + lon_inc, co3);
|
||||||
benv_lat_lon_to_co(lat + lat_inc, lon , co4);
|
benv_lat_lon_to_co(lat + lat_inc, lon, co4);
|
||||||
|
|
||||||
if (j != 0) { /* At pole, n1 and n2 are identical. */
|
if (j != 0) { /* At pole, n1 and n2 are identical. */
|
||||||
benv_add_tri(vbo, attr_id.pos, &v_idx, co1, co2, co3);
|
benv_add_tri(vbo, attr_id.pos, &v_idx, co1, co2, co3);
|
||||||
|
@ -654,7 +654,7 @@ static MeshRenderData *mesh_render_data_create_ex(
|
|||||||
|
|
||||||
/* If tangent from orco is requested, decrement tangent_len */
|
/* If tangent from orco is requested, decrement tangent_len */
|
||||||
int actual_tangent_len = (cd_lused[CD_TANGENT] & DM_TANGENT_MASK_ORCO) ?
|
int actual_tangent_len = (cd_lused[CD_TANGENT] & DM_TANGENT_MASK_ORCO) ?
|
||||||
rdata->cd.layers.tangent_len - 1 : rdata->cd.layers.tangent_len;
|
rdata->cd.layers.tangent_len - 1 : rdata->cd.layers.tangent_len;
|
||||||
if (rdata->edit_bmesh) {
|
if (rdata->edit_bmesh) {
|
||||||
BMEditMesh *em = rdata->edit_bmesh;
|
BMEditMesh *em = rdata->edit_bmesh;
|
||||||
BMesh *bm = em->bm;
|
BMesh *bm = em->bm;
|
||||||
@ -3107,7 +3107,7 @@ static Gwn_VertBuf *mesh_create_edge_pos_with_sel(
|
|||||||
|
|
||||||
const int edge_len = mesh_render_data_edges_len_get(rdata);
|
const int edge_len = mesh_render_data_edges_len_get(rdata);
|
||||||
|
|
||||||
vbo= GWN_vertbuf_create_with_format(&format);
|
vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
|
|
||||||
const int vbo_len_capacity = edge_len * 2;
|
const int vbo_len_capacity = edge_len * 2;
|
||||||
int vbo_len_used = 0;
|
int vbo_len_used = 0;
|
||||||
|
@ -1997,7 +1997,7 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state)
|
|||||||
unit_m4(obmat);
|
unit_m4(obmat);
|
||||||
|
|
||||||
if (shgroup->type == DRW_SHG_INSTANCE &&
|
if (shgroup->type == DRW_SHG_INSTANCE &&
|
||||||
(interface->instance_count > 0 || interface->instance_batch != NULL))
|
(interface->instance_count > 0 || interface->instance_batch != NULL))
|
||||||
{
|
{
|
||||||
GPU_SELECT_LOAD_IF_PICKSEL_LIST(&shgroup->calls);
|
GPU_SELECT_LOAD_IF_PICKSEL_LIST(&shgroup->calls);
|
||||||
draw_geometry(shgroup, shgroup->instance_geom, obmat, shgroup->instance_data);
|
draw_geometry(shgroup, shgroup->instance_geom, obmat, shgroup->instance_data);
|
||||||
|
@ -85,7 +85,7 @@ void DRW_stats_begin(void)
|
|||||||
DTP.timer_count = DTP.chunk_count * CHUNK_SIZE;
|
DTP.timer_count = DTP.chunk_count * CHUNK_SIZE;
|
||||||
DTP.timers = MEM_callocN(sizeof(DRWTimer) * DTP.timer_count, "DRWTimer stack");
|
DTP.timers = MEM_callocN(sizeof(DRWTimer) * DTP.timer_count, "DRWTimer stack");
|
||||||
}
|
}
|
||||||
else if(!DTP.is_recording && DTP.timers != NULL) {
|
else if (!DTP.is_recording && DTP.timers != NULL) {
|
||||||
DRW_stats_free();
|
DRW_stats_free();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,6 @@
|
|||||||
#include "BKE_image.h"
|
#include "BKE_image.h"
|
||||||
#include "BKE_texture.h"
|
#include "BKE_texture.h"
|
||||||
|
|
||||||
#include "ED_view3d.h"
|
|
||||||
#include "ED_view3d.h"
|
#include "ED_view3d.h"
|
||||||
|
|
||||||
#include "GPU_shader.h"
|
#include "GPU_shader.h"
|
||||||
@ -119,7 +118,7 @@ typedef struct OBJECT_Data {
|
|||||||
|
|
||||||
/* *********** STATIC *********** */
|
/* *********** STATIC *********** */
|
||||||
|
|
||||||
typedef struct OBJECT_PrivateData{
|
typedef struct OBJECT_PrivateData {
|
||||||
/* Empties */
|
/* Empties */
|
||||||
DRWShadingGroup *plain_axes;
|
DRWShadingGroup *plain_axes;
|
||||||
DRWShadingGroup *cube;
|
DRWShadingGroup *cube;
|
||||||
@ -487,7 +486,8 @@ static void OBJECT_engine_init(void *vedata)
|
|||||||
/* Persp : If camera is below floor plane, we switch clipping
|
/* Persp : If camera is below floor plane, we switch clipping
|
||||||
* Ortho : If eye vector is looking up, we switch clipping */
|
* Ortho : If eye vector is looking up, we switch clipping */
|
||||||
if (((winmat[3][3] == 0.0f) && (e_data.camera_pos[2] > 0.0f)) ||
|
if (((winmat[3][3] == 0.0f) && (e_data.camera_pos[2] > 0.0f)) ||
|
||||||
((winmat[3][3] != 0.0f) && (zvec[2] < 0.0f))) {
|
((winmat[3][3] != 0.0f) && (zvec[2] < 0.0f)))
|
||||||
|
{
|
||||||
e_data.zpos_flag |= CLIP_ZPOS;
|
e_data.zpos_flag |= CLIP_ZPOS;
|
||||||
e_data.zneg_flag |= CLIP_ZNEG;
|
e_data.zneg_flag |= CLIP_ZNEG;
|
||||||
}
|
}
|
||||||
@ -1548,7 +1548,7 @@ static void DRW_shgroup_lightprobe(OBJECT_StorageList *stl, OBJECT_PassList *psl
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (prb->type == LIGHTPROBE_TYPE_GRID ||
|
if (prb->type == LIGHTPROBE_TYPE_GRID ||
|
||||||
prb->attenuation_type == LIGHTPROBE_SHAPE_BOX)
|
prb->attenuation_type == LIGHTPROBE_SHAPE_BOX)
|
||||||
{
|
{
|
||||||
DRW_shgroup_call_dynamic_add(stl->g_data->cube, color, &prb->distgridinf, ob->obmat);
|
DRW_shgroup_call_dynamic_add(stl->g_data->cube, color, &prb->distgridinf, ob->obmat);
|
||||||
DRW_shgroup_call_dynamic_add(stl->g_data->cube, color, &prb->distfalloff, ob->obmat);
|
DRW_shgroup_call_dynamic_add(stl->g_data->cube, color, &prb->distfalloff, ob->obmat);
|
||||||
|
@ -2033,12 +2033,12 @@ static void sk_drawSketch(Scene *scene, View3D *UNUSED(v3d), SK_Sketch *sketch,
|
|||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
switch (sketch->next_point.mode) {
|
switch (sketch->next_point.mode) {
|
||||||
case PT_SNAP:
|
case PT_SNAP:
|
||||||
copy_v4_fl4(tmp_color, 0.0f, 1.0f, 0.0f, 1.0f);
|
copy_v4_fl4(tmp_color, 0.0f, 1.0f, 0.0f, 1.0f);
|
||||||
break;
|
break;
|
||||||
case PT_PROJECT:
|
case PT_PROJECT:
|
||||||
copy_v4_fl4(tmp_color, 0.0f, 0.0f, 0.0f, 1.0f);
|
copy_v4_fl4(tmp_color, 0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sk_drawPoint(&sketch->next_point, 0.1, tmp_color);
|
sk_drawPoint(&sketch->next_point, 0.1, tmp_color);
|
||||||
|
@ -1650,7 +1650,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti
|
|||||||
immUniformColor3ubv((unsigned char *)wcol->item);
|
immUniformColor3ubv((unsigned char *)wcol->item);
|
||||||
glEnable(GL_LINE_SMOOTH);
|
glEnable(GL_LINE_SMOOTH);
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
immBegin(GWN_PRIM_LINE_STRIP, (CM_TABLE+1) + 2);
|
immBegin(GWN_PRIM_LINE_STRIP, (CM_TABLE + 1) + 2);
|
||||||
|
|
||||||
if (cuma->table == NULL)
|
if (cuma->table == NULL)
|
||||||
curvemapping_changed(cumap, false);
|
curvemapping_changed(cumap, false);
|
||||||
@ -1812,14 +1812,14 @@ void ui_draw_but_TRACKPREVIEW(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wc
|
|||||||
UI_GetThemeColor4fv(TH_MARKER_OUTLINE, col_outline);
|
UI_GetThemeColor4fv(TH_MARKER_OUTLINE, col_outline);
|
||||||
|
|
||||||
/* Do stipple cross with geometry */
|
/* Do stipple cross with geometry */
|
||||||
immBegin(GWN_PRIM_LINES, 7*2*2);
|
immBegin(GWN_PRIM_LINES, 7 * 2 * 2);
|
||||||
float pos_sel[8] = {-10.0f, -7.0f, -4.0f, -1.0f, 2.0f, 5.0f, 8.0f, 11.0f};
|
float pos_sel[8] = {-10.0f, -7.0f, -4.0f, -1.0f, 2.0f, 5.0f, 8.0f, 11.0f};
|
||||||
for (int axe = 0; axe < 2; ++axe) {
|
for (int axe = 0; axe < 2; ++axe) {
|
||||||
for (int i = 0; i < 7; ++i) {
|
for (int i = 0; i < 7; ++i) {
|
||||||
float x1 = pos_sel[i] * (1 - axe);
|
float x1 = pos_sel[i] * (1 - axe);
|
||||||
float y1 = pos_sel[i] * axe;
|
float y1 = pos_sel[i] * axe;
|
||||||
float x2 = pos_sel[i+1] * (1 - axe);
|
float x2 = pos_sel[i + 1] * (1 - axe);
|
||||||
float y2 = pos_sel[i+1] * axe;
|
float y2 = pos_sel[i + 1] * axe;
|
||||||
|
|
||||||
if (i % 2 == 1)
|
if (i % 2 == 1)
|
||||||
immAttrib4fv(col, col_sel);
|
immAttrib4fv(col, col_sel);
|
||||||
|
@ -121,7 +121,7 @@ static void template_add_button_search_menu(
|
|||||||
/* Ugly exception for screens here, drawing their preview in icon size looks ugly/useless */
|
/* Ugly exception for screens here, drawing their preview in icon size looks ugly/useless */
|
||||||
const bool use_preview_icon = use_big_size || (id && (GS(id->name) != ID_SCR));
|
const bool use_preview_icon = use_big_size || (id && (GS(id->name) != ID_SCR));
|
||||||
const short width = UI_UNIT_X * (use_big_size ? 6 : 1.6f);
|
const short width = UI_UNIT_X * (use_big_size ? 6 : 1.6f);
|
||||||
const short height = UI_UNIT_Y * (use_big_size ? 6: 1);
|
const short height = UI_UNIT_Y * (use_big_size ? 6 : 1);
|
||||||
|
|
||||||
but = uiDefBlockButN(block, block_func, block_argN, "", 0, 0, width, height, tip);
|
but = uiDefBlockButN(block, block_func, block_argN, "", 0, 0, width, height, tip);
|
||||||
if (use_preview_icon) {
|
if (use_preview_icon) {
|
||||||
|
@ -1565,7 +1565,7 @@ void UI_view2d_multi_grid_draw(View2D *v2d, int colorid, float step, int level_s
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* X and Y axis */
|
/* X and Y axis */
|
||||||
UI_GetThemeColorShade3ubv(colorid, -18 + ((totlevels - 1) * -6) , grid_line_color);
|
UI_GetThemeColorShade3ubv(colorid, -18 + ((totlevels - 1) * -6), grid_line_color);
|
||||||
|
|
||||||
immSkipAttrib(color);
|
immSkipAttrib(color);
|
||||||
immVertex2f(pos, 0.0f, v2d->cur.ymin);
|
immVertex2f(pos, 0.0f, v2d->cur.ymin);
|
||||||
|
@ -221,7 +221,7 @@ static void dial_ghostarc_get_angles(
|
|||||||
plane_from_point_normal_v3(dial_plane, mpr->matrix_basis[3], axis_vec);
|
plane_from_point_normal_v3(dial_plane, mpr->matrix_basis[3], axis_vec);
|
||||||
|
|
||||||
if (!ED_view3d_win_to_ray(ar, v3d, inter->init_mval, ray_co, ray_no, false) ||
|
if (!ED_view3d_win_to_ray(ar, v3d, inter->init_mval, ray_co, ray_no, false) ||
|
||||||
!isect_ray_plane_v3(ray_co, ray_no, dial_plane, &ray_lambda, false))
|
!isect_ray_plane_v3(ray_co, ray_no, dial_plane, &ray_lambda, false))
|
||||||
{
|
{
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ static void dial_ghostarc_get_angles(
|
|||||||
sub_v3_v3(proj_mval_init_rel, mpr->matrix_basis[3]);
|
sub_v3_v3(proj_mval_init_rel, mpr->matrix_basis[3]);
|
||||||
|
|
||||||
if (!ED_view3d_win_to_ray(ar, v3d, mval, ray_co, ray_no, false) ||
|
if (!ED_view3d_win_to_ray(ar, v3d, mval, ray_co, ray_no, false) ||
|
||||||
!isect_ray_plane_v3(ray_co, ray_no, dial_plane, &ray_lambda, false))
|
!isect_ray_plane_v3(ray_co, ray_no, dial_plane, &ray_lambda, false))
|
||||||
{
|
{
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -823,8 +823,8 @@ void ED_mask_draw_frames(Mask *mask, ARegion *ar, const int cfra, const int sfra
|
|||||||
immBegin(GWN_PRIM_LINES, 2 * num_lines);
|
immBegin(GWN_PRIM_LINES, 2 * num_lines);
|
||||||
|
|
||||||
for (MaskLayerShape *masklay_shape = masklay->splines_shapes.first;
|
for (MaskLayerShape *masklay_shape = masklay->splines_shapes.first;
|
||||||
masklay_shape;
|
masklay_shape;
|
||||||
masklay_shape = masklay_shape->next)
|
masklay_shape = masklay_shape->next)
|
||||||
{
|
{
|
||||||
int frame = masklay_shape->frame;
|
int frame = masklay_shape->frame;
|
||||||
|
|
||||||
|
@ -3303,13 +3303,13 @@ static int edbm_separate_exec(bContext *C, wmOperator *op)
|
|||||||
/* editmode separate */
|
/* editmode separate */
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case MESH_SEPARATE_SELECTED:
|
case MESH_SEPARATE_SELECTED:
|
||||||
retval = mesh_separate_selected(bmain, scene, sl, base, em->bm);
|
retval = mesh_separate_selected(bmain, scene, sl, base, em->bm);
|
||||||
break;
|
break;
|
||||||
case MESH_SEPARATE_MATERIAL:
|
case MESH_SEPARATE_MATERIAL:
|
||||||
retval = mesh_separate_material(bmain, scene, sl, base, em->bm);
|
retval = mesh_separate_material(bmain, scene, sl, base, em->bm);
|
||||||
break;
|
break;
|
||||||
case MESH_SEPARATE_LOOSE:
|
case MESH_SEPARATE_LOOSE:
|
||||||
retval = mesh_separate_loose(bmain, scene, sl, base, em->bm);
|
retval = mesh_separate_loose(bmain, scene, sl, base, em->bm);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BLI_assert(0);
|
BLI_assert(0);
|
||||||
@ -3344,10 +3344,10 @@ static int edbm_separate_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case MESH_SEPARATE_MATERIAL:
|
case MESH_SEPARATE_MATERIAL:
|
||||||
retval_iter = mesh_separate_material(bmain, scene, sl, base_iter, bm_old);
|
retval_iter = mesh_separate_material(bmain, scene, sl, base_iter, bm_old);
|
||||||
break;
|
break;
|
||||||
case MESH_SEPARATE_LOOSE:
|
case MESH_SEPARATE_LOOSE:
|
||||||
retval_iter = mesh_separate_loose(bmain, scene, sl, base_iter, bm_old);
|
retval_iter = mesh_separate_loose(bmain, scene, sl, base_iter, bm_old);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BLI_assert(0);
|
BLI_assert(0);
|
||||||
|
@ -146,7 +146,7 @@ static void object_fmap_swap_object_mode(Object *ob, int num1, int num2)
|
|||||||
if (num1 != -1) {
|
if (num1 != -1) {
|
||||||
if (map[i] == num1)
|
if (map[i] == num1)
|
||||||
map[i] = num2;
|
map[i] = num2;
|
||||||
else if (map[i]== num2)
|
else if (map[i] == num2)
|
||||||
map[i] = num1;
|
map[i] = num1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -940,13 +940,13 @@ static int object_select_all_exec(bContext *C, wmOperator *op)
|
|||||||
{
|
{
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case SEL_SELECT:
|
case SEL_SELECT:
|
||||||
ED_object_base_select(base, BA_SELECT);
|
ED_object_base_select(base, BA_SELECT);
|
||||||
break;
|
break;
|
||||||
case SEL_DESELECT:
|
case SEL_DESELECT:
|
||||||
ED_object_base_select(base, BA_DESELECT);
|
ED_object_base_select(base, BA_DESELECT);
|
||||||
break;
|
break;
|
||||||
case SEL_INVERT:
|
case SEL_INVERT:
|
||||||
if ((base->flag & BASE_SELECTED) != 0) {
|
if ((base->flag & BASE_SELECTED) != 0) {
|
||||||
ED_object_base_select(base, BA_DESELECT);
|
ED_object_base_select(base, BA_DESELECT);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -234,7 +234,7 @@ void clip_draw_dopesheet_main(SpaceClip *sc, ARegion *ar, Scene *scene)
|
|||||||
|
|
||||||
/* check if visible */
|
/* check if visible */
|
||||||
if (IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
|
if (IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) ||
|
||||||
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax))
|
IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax))
|
||||||
{
|
{
|
||||||
MovieTrackingTrack *track = channel->track;
|
MovieTrackingTrack *track = channel->track;
|
||||||
int i;
|
int i;
|
||||||
|
@ -400,7 +400,7 @@ static void file_draw_preview(
|
|||||||
/* border */
|
/* border */
|
||||||
if (use_dropshadow) {
|
if (use_dropshadow) {
|
||||||
Gwn_VertFormat *format = immVertexFormat();
|
Gwn_VertFormat *format = immVertexFormat();
|
||||||
unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2,GWN_FETCH_FLOAT);
|
unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
|
||||||
|
|
||||||
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
|
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
|
||||||
immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f);
|
immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f);
|
||||||
|
@ -49,8 +49,6 @@
|
|||||||
#include "ED_node.h"
|
#include "ED_node.h"
|
||||||
#include "ED_render.h"
|
#include "ED_render.h"
|
||||||
#include "ED_screen.h"
|
#include "ED_screen.h"
|
||||||
#include "WM_api.h"
|
|
||||||
#include "WM_types.h"
|
|
||||||
|
|
||||||
#include "UI_resources.h"
|
#include "UI_resources.h"
|
||||||
#include "UI_view2d.h"
|
#include "UI_view2d.h"
|
||||||
@ -58,6 +56,7 @@
|
|||||||
#include "RNA_access.h"
|
#include "RNA_access.h"
|
||||||
|
|
||||||
#include "WM_api.h"
|
#include "WM_api.h"
|
||||||
|
#include "WM_types.h"
|
||||||
|
|
||||||
#include "node_intern.h" /* own include */
|
#include "node_intern.h" /* own include */
|
||||||
|
|
||||||
|
@ -333,9 +333,7 @@ static void time_draw_idblock_keyframes(View2D *v2d, ID *id, short onlysel, cons
|
|||||||
|
|
||||||
immBeginAtMost(GWN_PRIM_LINES, max_len * 2);
|
immBeginAtMost(GWN_PRIM_LINES, max_len * 2);
|
||||||
|
|
||||||
for (; (ak) && (ak->cfra <= v2d->cur.xmax);
|
for (; (ak) && (ak->cfra <= v2d->cur.xmax); ak = ak->next) {
|
||||||
ak = ak->next)
|
|
||||||
{
|
|
||||||
immVertex2f(pos, ak->cfra, ymin);
|
immVertex2f(pos, ak->cfra, ymin);
|
||||||
immVertex2f(pos, ak->cfra, ymax);
|
immVertex2f(pos, ak->cfra, ymax);
|
||||||
}
|
}
|
||||||
|
@ -439,7 +439,7 @@ static void drawcube_size(float xsize, float ysize, float zsize)
|
|||||||
/* Elements */
|
/* Elements */
|
||||||
GWN_indexbuf_init(&elb, GWN_PRIM_LINES, 12, 8);
|
GWN_indexbuf_init(&elb, GWN_PRIM_LINES, 12, 8);
|
||||||
for (int i = 0; i < 12; ++i) {
|
for (int i = 0; i < 12; ++i) {
|
||||||
GWN_indexbuf_add_line_verts(&elb, cube_wire[i*2], cube_wire[i*2+1]);
|
GWN_indexbuf_add_line_verts(&elb, cube_wire[i * 2], cube_wire[i * 2 + 1]);
|
||||||
}
|
}
|
||||||
GWN_indexbuf_build_in_place(&elb, &el);
|
GWN_indexbuf_build_in_place(&elb, &el);
|
||||||
|
|
||||||
@ -591,7 +591,7 @@ static void draw_bone_octahedral(void)
|
|||||||
/* Elements */
|
/* Elements */
|
||||||
GWN_indexbuf_init(&elb, GWN_PRIM_LINES, 12, 6);
|
GWN_indexbuf_init(&elb, GWN_PRIM_LINES, 12, 6);
|
||||||
for (int i = 0; i < 12; ++i) {
|
for (int i = 0; i < 12; ++i) {
|
||||||
GWN_indexbuf_add_line_verts(&elb, bone_octahedral_wire[i*2], bone_octahedral_wire[i*2+1]);
|
GWN_indexbuf_add_line_verts(&elb, bone_octahedral_wire[i * 2], bone_octahedral_wire[i * 2 + 1]);
|
||||||
}
|
}
|
||||||
GWN_indexbuf_build_in_place(&elb, &el);
|
GWN_indexbuf_build_in_place(&elb, &el);
|
||||||
|
|
||||||
@ -938,7 +938,7 @@ static void draw_sphere_bone_wire(float smat[4][4], float imat[4][4],
|
|||||||
|
|
||||||
/* base */
|
/* base */
|
||||||
if (armflag & ARM_EDITMODE) {
|
if (armflag & ARM_EDITMODE) {
|
||||||
if (boneflag & BONE_SELECTED){
|
if (boneflag & BONE_SELECTED) {
|
||||||
UI_GetThemeColor4fv(TH_SELECT, fcolor);
|
UI_GetThemeColor4fv(TH_SELECT, fcolor);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1738,7 +1738,7 @@ static void imm_sphere_project(unsigned int pos, float ax, float az)
|
|||||||
static void draw_dof_ellipse(unsigned int pos, float ax, float az)
|
static void draw_dof_ellipse(unsigned int pos, float ax, float az)
|
||||||
{
|
{
|
||||||
const int n = 16;
|
const int n = 16;
|
||||||
const int tri = n*n - 2*n + 1; /* Yay fancy math ! */
|
const int tri = n * n - 2 * n + 1; /* Yay fancy math ! */
|
||||||
const float staticSine[16] = {
|
const float staticSine[16] = {
|
||||||
0.0f, 0.104528463268f, 0.207911690818f, 0.309016994375f,
|
0.0f, 0.104528463268f, 0.207911690818f, 0.309016994375f,
|
||||||
0.406736643076f, 0.5f, 0.587785252292f, 0.669130606359f,
|
0.406736643076f, 0.5f, 0.587785252292f, 0.669130606359f,
|
||||||
@ -1755,7 +1755,7 @@ static void draw_dof_ellipse(unsigned int pos, float ax, float az)
|
|||||||
|
|
||||||
immUniformColor4ub(70, 70, 70, 50);
|
immUniformColor4ub(70, 70, 70, 50);
|
||||||
|
|
||||||
immBegin(GWN_PRIM_TRIS, tri*3);
|
immBegin(GWN_PRIM_TRIS, tri * 3);
|
||||||
pz = 0.0f;
|
pz = 0.0f;
|
||||||
for (i = 1; i < n; i++) {
|
for (i = 1; i < n; i++) {
|
||||||
z = staticSine[i];
|
z = staticSine[i];
|
||||||
@ -2245,8 +2245,11 @@ static void draw_pose_bones(
|
|||||||
if (arm->flag & ARM_POSEMODE) {
|
if (arm->flag & ARM_POSEMODE) {
|
||||||
if (constflag & PCHAN_HAS_IK) {
|
if (constflag & PCHAN_HAS_IK) {
|
||||||
if (bone->flag & BONE_SELECTED) {
|
if (bone->flag & BONE_SELECTED) {
|
||||||
if (constflag & PCHAN_HAS_TARGET) rgba_float_args_set(fcolor, 200.f/255.f, 120.f/255.f, 0.f/255.f, 1.0f);
|
if (constflag & PCHAN_HAS_TARGET) {
|
||||||
else rgba_float_args_set(fcolor, 200.f/255.f, 200.f/255.f, 50.f/255.f, 1.0f); /* add theme! */
|
rgba_float_args_set(fcolor, 200.f / 255.f, 120.f / 255.f, 0.f / 255.f, 1.0f);
|
||||||
|
}
|
||||||
|
/* add theme! */
|
||||||
|
else rgba_float_args_set(fcolor, 200.f / 255.f, 200.f / 255.f, 50.f / 255.f, 1.0f);
|
||||||
|
|
||||||
GPU_select_load_id(index & 0xFFFF);
|
GPU_select_load_id(index & 0xFFFF);
|
||||||
pchan_draw_IK_root_lines(pchan, !(do_dashed & DASH_HELP_LINES));
|
pchan_draw_IK_root_lines(pchan, !(do_dashed & DASH_HELP_LINES));
|
||||||
@ -2254,7 +2257,8 @@ static void draw_pose_bones(
|
|||||||
}
|
}
|
||||||
else if (constflag & PCHAN_HAS_SPLINEIK) {
|
else if (constflag & PCHAN_HAS_SPLINEIK) {
|
||||||
if (bone->flag & BONE_SELECTED) {
|
if (bone->flag & BONE_SELECTED) {
|
||||||
rgba_float_args_set(fcolor, 150.f/255.f, 200.f/255.f, 50.f/255.f, 1.0f); /* add theme! */
|
/* add theme! */
|
||||||
|
rgba_float_args_set(fcolor, 150.f / 255.f, 200.f / 255.f, 50.f / 255.f, 1.0f);
|
||||||
|
|
||||||
GPU_select_load_id(index & 0xFFFF);
|
GPU_select_load_id(index & 0xFFFF);
|
||||||
pchan_draw_IK_root_lines(pchan, !(do_dashed & DASH_HELP_LINES));
|
pchan_draw_IK_root_lines(pchan, !(do_dashed & DASH_HELP_LINES));
|
||||||
|
@ -823,7 +823,7 @@ static void drawcentercircle(View3D *v3d, RegionView3D *UNUSED(rv3d), const floa
|
|||||||
const float outlineWidth = 1.0f * U.pixelsize;
|
const float outlineWidth = 1.0f * U.pixelsize;
|
||||||
const float size = U.obcenter_dia * U.pixelsize + outlineWidth;
|
const float size = U.obcenter_dia * U.pixelsize + outlineWidth;
|
||||||
|
|
||||||
if (v3d->zbuf) {
|
if (v3d->zbuf) {
|
||||||
glDisable(GL_DEPTH_TEST);
|
glDisable(GL_DEPTH_TEST);
|
||||||
/* TODO(merwin): fit things like this into plates/buffers design */
|
/* TODO(merwin): fit things like this into plates/buffers design */
|
||||||
}
|
}
|
||||||
@ -860,7 +860,7 @@ static void drawcentercircle(View3D *v3d, RegionView3D *UNUSED(rv3d), const floa
|
|||||||
GPU_disable_program_point_size();
|
GPU_disable_program_point_size();
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
if (v3d->zbuf) {
|
if (v3d->zbuf) {
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8760,7 +8760,7 @@ void draw_object(
|
|||||||
if ((dflag & DRAW_PICKING) == 0) {
|
if ((dflag & DRAW_PICKING) == 0) {
|
||||||
if ((dt == OB_BOUNDBOX) || ELEM(ob->type, OB_EMPTY, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
|
if ((dt == OB_BOUNDBOX) || ELEM(ob->type, OB_EMPTY, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
|
||||||
goto afterdraw;
|
goto afterdraw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (ob->type) {
|
switch (ob->type) {
|
||||||
|
@ -64,13 +64,11 @@
|
|||||||
|
|
||||||
#include "DRW_engine.h"
|
#include "DRW_engine.h"
|
||||||
|
|
||||||
#include "ED_keyframing.h"
|
|
||||||
#include "ED_armature.h"
|
#include "ED_armature.h"
|
||||||
#include "ED_keyframing.h"
|
#include "ED_keyframing.h"
|
||||||
#include "ED_gpencil.h"
|
#include "ED_gpencil.h"
|
||||||
#include "ED_screen.h"
|
#include "ED_screen.h"
|
||||||
#include "ED_transform.h"
|
#include "ED_transform.h"
|
||||||
#include "ED_gpencil.h"
|
|
||||||
|
|
||||||
#include "DEG_depsgraph_query.h"
|
#include "DEG_depsgraph_query.h"
|
||||||
|
|
||||||
|
@ -72,8 +72,6 @@
|
|||||||
|
|
||||||
#include "DEG_depsgraph.h"
|
#include "DEG_depsgraph.h"
|
||||||
|
|
||||||
#include "RE_engine.h"
|
|
||||||
|
|
||||||
#include "IMB_imbuf_types.h"
|
#include "IMB_imbuf_types.h"
|
||||||
#include "IMB_imbuf.h"
|
#include "IMB_imbuf.h"
|
||||||
#include "IMB_colormanagement.h"
|
#include "IMB_colormanagement.h"
|
||||||
|
@ -3676,8 +3676,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
|
|||||||
new_dist = rv3d->dist;
|
new_dist = rv3d->dist;
|
||||||
|
|
||||||
/* convert the drawn rectangle into 3d space */
|
/* convert the drawn rectangle into 3d space */
|
||||||
if (depth_close != FLT_MAX && ED_view3d_unproject(ar, centx, centy, depth_close, p))
|
if (depth_close != FLT_MAX && ED_view3d_unproject(ar, centx, centy, depth_close, p)) {
|
||||||
{
|
|
||||||
negate_v3_v3(new_ofs, p);
|
negate_v3_v3(new_ofs, p);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -4940,8 +4939,7 @@ bool ED_view3d_autodist(
|
|||||||
float centx = (float)mval[0] + 0.5f;
|
float centx = (float)mval[0] + 0.5f;
|
||||||
float centy = (float)mval[1] + 0.5f;
|
float centy = (float)mval[1] + 0.5f;
|
||||||
|
|
||||||
if (ED_view3d_unproject(ar, centx, centy, depth_close, mouse_worldloc))
|
if (ED_view3d_unproject(ar, centx, centy, depth_close, mouse_worldloc)) {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -317,7 +317,7 @@ static bool fcu_test_selected(FCurve *fcu)
|
|||||||
/* helper for recalcData() - for Action Editor transforms */
|
/* helper for recalcData() - for Action Editor transforms */
|
||||||
static void recalcData_actedit(TransInfo *t)
|
static void recalcData_actedit(TransInfo *t)
|
||||||
{
|
{
|
||||||
SceneLayer *sl= t->scene_layer;
|
SceneLayer *sl = t->scene_layer;
|
||||||
SpaceAction *saction = (SpaceAction *)t->sa->spacedata.first;
|
SpaceAction *saction = (SpaceAction *)t->sa->spacedata.first;
|
||||||
|
|
||||||
bAnimContext ac = {NULL};
|
bAnimContext ac = {NULL};
|
||||||
|
@ -1185,7 +1185,7 @@ static void WIDGETGROUP_manipulator_setup(const bContext *UNUSED(C), wmManipulat
|
|||||||
/* custom handler! */
|
/* custom handler! */
|
||||||
WM_manipulator_set_fn_custom_modal(axis, manipulator_modal);
|
WM_manipulator_set_fn_custom_modal(axis, manipulator_modal);
|
||||||
|
|
||||||
switch(axis_idx) {
|
switch (axis_idx) {
|
||||||
case MAN_AXIS_TRANS_X:
|
case MAN_AXIS_TRANS_X:
|
||||||
case MAN_AXIS_TRANS_Y:
|
case MAN_AXIS_TRANS_Y:
|
||||||
case MAN_AXIS_TRANS_Z:
|
case MAN_AXIS_TRANS_Z:
|
||||||
|
@ -1574,8 +1574,9 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *ar
|
|||||||
UI_GetThemeColor4fv(TH_STITCH_PREVIEW_ACTIVE, col);
|
UI_GetThemeColor4fv(TH_STITCH_PREVIEW_ACTIVE, col);
|
||||||
vbo = GWN_vertbuf_create_with_format(&format);
|
vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
GWN_vertbuf_data_alloc(vbo, stitch_preview->num_static_tris * 3);
|
GWN_vertbuf_data_alloc(vbo, stitch_preview->num_static_tris * 3);
|
||||||
for (int i = 0; i < stitch_preview->num_static_tris * 3; i++)
|
for (int i = 0; i < stitch_preview->num_static_tris * 3; i++) {
|
||||||
GWN_vertbuf_attr_set(vbo, pos_id, i, &stitch_preview->static_tris[i*2]);
|
GWN_vertbuf_attr_set(vbo, pos_id, i, &stitch_preview->static_tris[i * 2]);
|
||||||
|
}
|
||||||
stitch_draw_vbo(vbo, GWN_PRIM_TRIS, col);
|
stitch_draw_vbo(vbo, GWN_PRIM_TRIS, col);
|
||||||
|
|
||||||
|
|
||||||
@ -1601,16 +1602,17 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *ar
|
|||||||
|
|
||||||
for (j = 1; j < stitch_preview->uvs_per_polygon[i] - 1; ++j) {
|
for (j = 1; j < stitch_preview->uvs_per_polygon[i] - 1; ++j) {
|
||||||
GWN_vertbuf_attr_set(vbo, pos_id, tri_idx++, &stitch_preview->preview_polys[index]);
|
GWN_vertbuf_attr_set(vbo, pos_id, tri_idx++, &stitch_preview->preview_polys[index]);
|
||||||
GWN_vertbuf_attr_set(vbo, pos_id, tri_idx++, &stitch_preview->preview_polys[index + (j+0)*2]);
|
GWN_vertbuf_attr_set(vbo, pos_id, tri_idx++, &stitch_preview->preview_polys[index + (j + 0) * 2]);
|
||||||
GWN_vertbuf_attr_set(vbo, pos_id, tri_idx++, &stitch_preview->preview_polys[index + (j+1)*2]);
|
GWN_vertbuf_attr_set(vbo, pos_id, tri_idx++, &stitch_preview->preview_polys[index + (j + 1) * 2]);
|
||||||
|
|
||||||
GWN_vertbuf_attr_set(vbo_line, pos_id, line_idx++, &stitch_preview->preview_polys[index + (j+0)*2]);
|
GWN_vertbuf_attr_set(vbo_line, pos_id, line_idx++, &stitch_preview->preview_polys[index + (j + 0) * 2]);
|
||||||
GWN_vertbuf_attr_set(vbo_line, pos_id, line_idx++, &stitch_preview->preview_polys[index + (j+1)*2]);
|
GWN_vertbuf_attr_set(vbo_line, pos_id, line_idx++, &stitch_preview->preview_polys[index + (j + 1) * 2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Closing line */
|
/* Closing line */
|
||||||
GWN_vertbuf_attr_set(vbo_line, pos_id, line_idx++, &stitch_preview->preview_polys[index]);
|
GWN_vertbuf_attr_set(vbo_line, pos_id, line_idx++, &stitch_preview->preview_polys[index]);
|
||||||
GWN_vertbuf_attr_set(vbo_line, pos_id, line_idx++, &stitch_preview->preview_polys[index + j*2]); /* j = uvs_per_polygon[i] - 1*/
|
/* j = uvs_per_polygon[i] - 1*/
|
||||||
|
GWN_vertbuf_attr_set(vbo_line, pos_id, line_idx++, &stitch_preview->preview_polys[index + j * 2]);
|
||||||
|
|
||||||
index += stitch_preview->uvs_per_polygon[i] * 2;
|
index += stitch_preview->uvs_per_polygon[i] * 2;
|
||||||
}
|
}
|
||||||
@ -1629,30 +1631,34 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *ar
|
|||||||
UI_GetThemeColor4fv(TH_STITCH_PREVIEW_STITCHABLE, col);
|
UI_GetThemeColor4fv(TH_STITCH_PREVIEW_STITCHABLE, col);
|
||||||
vbo = GWN_vertbuf_create_with_format(&format);
|
vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
GWN_vertbuf_data_alloc(vbo, stitch_preview->num_stitchable);
|
GWN_vertbuf_data_alloc(vbo, stitch_preview->num_stitchable);
|
||||||
for (int i = 0; i < stitch_preview->num_stitchable; i++)
|
for (int i = 0; i < stitch_preview->num_stitchable; i++) {
|
||||||
GWN_vertbuf_attr_set(vbo, pos_id, i, &stitch_preview->preview_stitchable[i*2]);
|
GWN_vertbuf_attr_set(vbo, pos_id, i, &stitch_preview->preview_stitchable[i * 2]);
|
||||||
|
}
|
||||||
stitch_draw_vbo(vbo, GWN_PRIM_POINTS, col);
|
stitch_draw_vbo(vbo, GWN_PRIM_POINTS, col);
|
||||||
|
|
||||||
UI_GetThemeColor4fv(TH_STITCH_PREVIEW_UNSTITCHABLE, col);
|
UI_GetThemeColor4fv(TH_STITCH_PREVIEW_UNSTITCHABLE, col);
|
||||||
vbo = GWN_vertbuf_create_with_format(&format);
|
vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
GWN_vertbuf_data_alloc(vbo, stitch_preview->num_unstitchable);
|
GWN_vertbuf_data_alloc(vbo, stitch_preview->num_unstitchable);
|
||||||
for (int i = 0; i < stitch_preview->num_unstitchable; i++)
|
for (int i = 0; i < stitch_preview->num_unstitchable; i++) {
|
||||||
GWN_vertbuf_attr_set(vbo, pos_id, i, &stitch_preview->preview_unstitchable[i*2]);
|
GWN_vertbuf_attr_set(vbo, pos_id, i, &stitch_preview->preview_unstitchable[i * 2]);
|
||||||
|
}
|
||||||
stitch_draw_vbo(vbo, GWN_PRIM_POINTS, col);
|
stitch_draw_vbo(vbo, GWN_PRIM_POINTS, col);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
UI_GetThemeColor4fv(TH_STITCH_PREVIEW_STITCHABLE, col);
|
UI_GetThemeColor4fv(TH_STITCH_PREVIEW_STITCHABLE, col);
|
||||||
vbo = GWN_vertbuf_create_with_format(&format);
|
vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
GWN_vertbuf_data_alloc(vbo, stitch_preview->num_stitchable * 2);
|
GWN_vertbuf_data_alloc(vbo, stitch_preview->num_stitchable * 2);
|
||||||
for (int i = 0; i < stitch_preview->num_stitchable * 2; i++)
|
for (int i = 0; i < stitch_preview->num_stitchable * 2; i++) {
|
||||||
GWN_vertbuf_attr_set(vbo, pos_id, i, &stitch_preview->preview_stitchable[i*2]);
|
GWN_vertbuf_attr_set(vbo, pos_id, i, &stitch_preview->preview_stitchable[i * 2]);
|
||||||
|
}
|
||||||
stitch_draw_vbo(vbo, GWN_PRIM_LINES, col);
|
stitch_draw_vbo(vbo, GWN_PRIM_LINES, col);
|
||||||
|
|
||||||
UI_GetThemeColor4fv(TH_STITCH_PREVIEW_UNSTITCHABLE, col);
|
UI_GetThemeColor4fv(TH_STITCH_PREVIEW_UNSTITCHABLE, col);
|
||||||
vbo = GWN_vertbuf_create_with_format(&format);
|
vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
GWN_vertbuf_data_alloc(vbo, stitch_preview->num_unstitchable * 2);
|
GWN_vertbuf_data_alloc(vbo, stitch_preview->num_unstitchable * 2);
|
||||||
for (int i = 0; i < stitch_preview->num_unstitchable * 2; i++)
|
for (int i = 0; i < stitch_preview->num_unstitchable * 2; i++) {
|
||||||
GWN_vertbuf_attr_set(vbo, pos_id, i, &stitch_preview->preview_unstitchable[i*2]);
|
GWN_vertbuf_attr_set(vbo, pos_id, i, &stitch_preview->preview_unstitchable[i * 2]);
|
||||||
|
}
|
||||||
stitch_draw_vbo(vbo, GWN_PRIM_LINES, col);
|
stitch_draw_vbo(vbo, GWN_PRIM_LINES, col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
#include "GPU_shader.h"
|
#include "GPU_shader.h"
|
||||||
|
|
||||||
/* Extend GWN_batch_program_set to use Blender’s library of built-in shader programs. */
|
/* Extend GWN_batch_program_set to use Blender’s library of built-in shader programs. */
|
||||||
void GWN_batch_program_set_builtin(Gwn_Batch*, GPUBuiltinShader);
|
void GWN_batch_program_set_builtin(Gwn_Batch *, GPUBuiltinShader);
|
||||||
|
|
||||||
/* Replacement for gluSphere */
|
/* Replacement for gluSphere */
|
||||||
Gwn_Batch *GPU_batch_preset_sphere(int lod);
|
Gwn_Batch *GPU_batch_preset_sphere(int lod);
|
||||||
|
@ -281,7 +281,7 @@ GPUFX *GPU_fx_compositor_create(void)
|
|||||||
}
|
}
|
||||||
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
|
||||||
GWN_vertbuf_data_alloc(vbo, 4);
|
GWN_vertbuf_data_alloc(vbo, 4);
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
GWN_vertbuf_attr_set(vbo, pos, i, fullscreencos[i]);
|
GWN_vertbuf_attr_set(vbo, pos, i, fullscreencos[i]);
|
||||||
GWN_vertbuf_attr_set(vbo, uvs, i, fullscreenuvs[i]);
|
GWN_vertbuf_attr_set(vbo, uvs, i, fullscreenuvs[i]);
|
||||||
}
|
}
|
||||||
|
@ -1280,7 +1280,7 @@ void GPU_create_smoke(SmokeModifierData *smd, int highres)
|
|||||||
}
|
}
|
||||||
sds->tex_flame = (smoke_turbulence_has_fuel(sds->wt)) ?
|
sds->tex_flame = (smoke_turbulence_has_fuel(sds->wt)) ?
|
||||||
GPU_texture_create_3D_custom(sds->res_wt[0], sds->res_wt[1], sds->res_wt[2], 1,
|
GPU_texture_create_3D_custom(sds->res_wt[0], sds->res_wt[1], sds->res_wt[2], 1,
|
||||||
GPU_R8, smoke_turbulence_get_flame(sds->wt), NULL):
|
GPU_R8, smoke_turbulence_get_flame(sds->wt), NULL) :
|
||||||
NULL;
|
NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2425,7 +2425,8 @@ void gpuPushAttrib(eGPUAttribMask mask)
|
|||||||
AttribStack.top++;
|
AttribStack.top++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void restore_mask(GLenum cap, const bool value) {
|
static void restore_mask(GLenum cap, const bool value)
|
||||||
|
{
|
||||||
if (value) {
|
if (value) {
|
||||||
glEnable(cap);
|
glEnable(cap);
|
||||||
}
|
}
|
||||||
|
@ -573,7 +573,7 @@ void GPU_framebuffer_recursive_downsample(
|
|||||||
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i=1; i < num_iter+1 && (current_dim[0] > 4 && current_dim[1] > 4); i++) {
|
for (i = 1; i < num_iter + 1 && (current_dim[0] > 4 && current_dim[1] > 4); i++) {
|
||||||
|
|
||||||
/* calculate next viewport size */
|
/* calculate next viewport size */
|
||||||
current_dim[0] /= 2;
|
current_dim[0] /= 2;
|
||||||
@ -587,8 +587,8 @@ void GPU_framebuffer_recursive_downsample(
|
|||||||
|
|
||||||
/* bind next level for rendering but first restrict fetches only to previous level */
|
/* bind next level for rendering but first restrict fetches only to previous level */
|
||||||
GPU_texture_bind(tex, 0);
|
GPU_texture_bind(tex, 0);
|
||||||
glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_BASE_LEVEL, i-1);
|
glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_BASE_LEVEL, i - 1);
|
||||||
glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, i-1);
|
glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, i - 1);
|
||||||
GPU_texture_unbind(tex);
|
GPU_texture_unbind(tex);
|
||||||
|
|
||||||
glFramebufferTexture(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), i);
|
glFramebufferTexture(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), i);
|
||||||
@ -601,7 +601,7 @@ void GPU_framebuffer_recursive_downsample(
|
|||||||
/* reset mipmap level range for the depth image */
|
/* reset mipmap level range for the depth image */
|
||||||
GPU_texture_bind(tex, 0);
|
GPU_texture_bind(tex, 0);
|
||||||
glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_BASE_LEVEL, 0);
|
glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_BASE_LEVEL, 0);
|
||||||
glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, i-1);
|
glTexParameteri(GPU_texture_target(tex), GL_TEXTURE_MAX_LEVEL, i - 1);
|
||||||
GPU_texture_unbind(tex);
|
GPU_texture_unbind(tex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,7 +376,7 @@ GPULamp *GPU_lamp_from_blender(Scene *scene, Object *ob, Object *par)
|
|||||||
|
|
||||||
void GPU_lamp_engine_data_free(LampEngineData *led)
|
void GPU_lamp_engine_data_free(LampEngineData *led)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MAX_LAMP_DATA; ++i) {
|
for (int i = 0; i < MAX_LAMP_DATA; ++i) {
|
||||||
if (led->storage[i]) {
|
if (led->storage[i]) {
|
||||||
MEM_freeN(led->storage[i]);
|
MEM_freeN(led->storage[i]);
|
||||||
led->storage[i] = NULL;
|
led->storage[i] = NULL;
|
||||||
|
@ -574,33 +574,33 @@ void gpuBindMatrices(const Gwn_ShaderInterface *shaderface)
|
|||||||
const Gwn_ShaderInput *P_inv = GWN_shaderinterface_uniform_builtin(shaderface, GWN_UNIFORM_PROJECTION_INV);
|
const Gwn_ShaderInput *P_inv = GWN_shaderinterface_uniform_builtin(shaderface, GWN_UNIFORM_PROJECTION_INV);
|
||||||
|
|
||||||
if (MV) {
|
if (MV) {
|
||||||
#if DEBUG_MATRIX_BIND
|
#if DEBUG_MATRIX_BIND
|
||||||
puts("setting MV matrix");
|
puts("setting MV matrix");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
glUniformMatrix4fv(MV->location, 1, GL_FALSE, (const float *)gpuGetModelViewMatrix(NULL));
|
glUniformMatrix4fv(MV->location, 1, GL_FALSE, (const float *)gpuGetModelViewMatrix(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (P) {
|
if (P) {
|
||||||
#if DEBUG_MATRIX_BIND
|
#if DEBUG_MATRIX_BIND
|
||||||
puts("setting P matrix");
|
puts("setting P matrix");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
glUniformMatrix4fv(P->location, 1, GL_FALSE, (const float *)gpuGetProjectionMatrix(NULL));
|
glUniformMatrix4fv(P->location, 1, GL_FALSE, (const float *)gpuGetProjectionMatrix(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MVP) {
|
if (MVP) {
|
||||||
#if DEBUG_MATRIX_BIND
|
#if DEBUG_MATRIX_BIND
|
||||||
puts("setting MVP matrix");
|
puts("setting MVP matrix");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
glUniformMatrix4fv(MVP->location, 1, GL_FALSE, (const float *)gpuGetModelViewProjectionMatrix(NULL));
|
glUniformMatrix4fv(MVP->location, 1, GL_FALSE, (const float *)gpuGetModelViewProjectionMatrix(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (N) {
|
if (N) {
|
||||||
#if DEBUG_MATRIX_BIND
|
#if DEBUG_MATRIX_BIND
|
||||||
puts("setting normal matrix");
|
puts("setting normal matrix");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
glUniformMatrix3fv(N->location, 1, GL_FALSE, (const float *)gpuGetNormalMatrix(NULL));
|
glUniformMatrix3fv(N->location, 1, GL_FALSE, (const float *)gpuGetNormalMatrix(NULL));
|
||||||
}
|
}
|
||||||
@ -609,14 +609,14 @@ void gpuBindMatrices(const Gwn_ShaderInterface *shaderface)
|
|||||||
Mat4 m;
|
Mat4 m;
|
||||||
gpuGetModelViewMatrix(m);
|
gpuGetModelViewMatrix(m);
|
||||||
invert_m4(m);
|
invert_m4(m);
|
||||||
glUniformMatrix4fv(MV_inv->location, 1, GL_FALSE, (const float*) m);
|
glUniformMatrix4fv(MV_inv->location, 1, GL_FALSE, (const float *)m);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (P_inv) {
|
if (P_inv) {
|
||||||
Mat4 m;
|
Mat4 m;
|
||||||
gpuGetProjectionMatrix(m);
|
gpuGetProjectionMatrix(m);
|
||||||
invert_m4(m);
|
invert_m4(m);
|
||||||
glUniformMatrix4fv(P_inv->location, 1, GL_FALSE, (const float*) m);
|
glUniformMatrix4fv(P_inv->location, 1, GL_FALSE, (const float *)m);
|
||||||
}
|
}
|
||||||
|
|
||||||
state.dirty = false;
|
state.dirty = false;
|
||||||
|
@ -727,7 +727,7 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader shader)
|
|||||||
[GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR] = { datatoc_gpu_shader_2D_image_vert_glsl,
|
[GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR] = { datatoc_gpu_shader_2D_image_vert_glsl,
|
||||||
datatoc_gpu_shader_image_shuffle_color_frag_glsl },
|
datatoc_gpu_shader_image_shuffle_color_frag_glsl },
|
||||||
[GPU_SHADER_3D_UNIFORM_COLOR] = { datatoc_gpu_shader_3D_vert_glsl, datatoc_gpu_shader_uniform_color_frag_glsl },
|
[GPU_SHADER_3D_UNIFORM_COLOR] = { datatoc_gpu_shader_3D_vert_glsl, datatoc_gpu_shader_uniform_color_frag_glsl },
|
||||||
[GPU_SHADER_3D_UNIFORM_COLOR_U32] = { datatoc_gpu_shader_3D_vert_glsl, datatoc_gpu_shader_uniform_color_frag_glsl },
|
[GPU_SHADER_3D_UNIFORM_COLOR_U32] = { datatoc_gpu_shader_3D_vert_glsl, datatoc_gpu_shader_uniform_color_frag_glsl },
|
||||||
[GPU_SHADER_3D_FLAT_COLOR] = { datatoc_gpu_shader_3D_flat_color_vert_glsl,
|
[GPU_SHADER_3D_FLAT_COLOR] = { datatoc_gpu_shader_3D_flat_color_vert_glsl,
|
||||||
datatoc_gpu_shader_flat_color_frag_glsl },
|
datatoc_gpu_shader_flat_color_frag_glsl },
|
||||||
[GPU_SHADER_3D_FLAT_COLOR_U32] = { datatoc_gpu_shader_3D_flat_color_vert_glsl,
|
[GPU_SHADER_3D_FLAT_COLOR_U32] = { datatoc_gpu_shader_3D_flat_color_vert_glsl,
|
||||||
|
@ -243,8 +243,8 @@ static GPUType get_padded_gpu_type(LinkData *link)
|
|||||||
|
|
||||||
/* Unless the vec3 is followed by a float we need to treat it as a vec4. */
|
/* Unless the vec3 is followed by a float we need to treat it as a vec4. */
|
||||||
if (gputype == GPU_VEC3 &&
|
if (gputype == GPU_VEC3 &&
|
||||||
(link->next != NULL) &&
|
(link->next != NULL) &&
|
||||||
(((GPUInput *)link->next->data)->type != GPU_FLOAT))
|
(((GPUInput *)link->next->data)->type != GPU_FLOAT))
|
||||||
{
|
{
|
||||||
gputype = GPU_VEC4;
|
gputype = GPU_VEC4;
|
||||||
}
|
}
|
||||||
@ -368,7 +368,8 @@ int GPU_uniformbuffer_bindpoint(GPUUniformBuffer *ubo)
|
|||||||
return ubo->bindpoint;
|
return ubo->bindpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU_uniformbuffer_tag_dirty(GPUUniformBuffer *ubo_) {
|
void GPU_uniformbuffer_tag_dirty(GPUUniformBuffer *ubo_)
|
||||||
|
{
|
||||||
BLI_assert(ubo_->type == GPU_UBO_DYNAMIC);
|
BLI_assert(ubo_->type == GPU_UBO_DYNAMIC);
|
||||||
GPUUniformBufferDynamic *ubo = (GPUUniformBufferDynamic *)ubo_;
|
GPUUniformBufferDynamic *ubo = (GPUUniformBufferDynamic *)ubo_;
|
||||||
ubo->flag |= GPU_UBO_FLAG_DIRTY;
|
ubo->flag |= GPU_UBO_FLAG_DIRTY;
|
||||||
|
@ -238,8 +238,8 @@ GPUTexture *GPU_viewport_texture_pool_query(GPUViewport *viewport, void *engine,
|
|||||||
|
|
||||||
for (ViewportTempTexture *tmp_tex = viewport->tex_pool.first; tmp_tex; tmp_tex = tmp_tex->next) {
|
for (ViewportTempTexture *tmp_tex = viewport->tex_pool.first; tmp_tex; tmp_tex = tmp_tex->next) {
|
||||||
if ((GPU_texture_width(tmp_tex->texture) == width) &&
|
if ((GPU_texture_width(tmp_tex->texture) == width) &&
|
||||||
(GPU_texture_height(tmp_tex->texture) == height) &&
|
(GPU_texture_height(tmp_tex->texture) == height) &&
|
||||||
(GPU_texture_format(tmp_tex->texture) == format))
|
(GPU_texture_format(tmp_tex->texture) == format))
|
||||||
{
|
{
|
||||||
/* Search if the engine is not already using this texture */
|
/* Search if the engine is not already using this texture */
|
||||||
for (int i = 0; i < MAX_ENGINE_BUFFER_SHARING; ++i) {
|
for (int i = 0; i < MAX_ENGINE_BUFFER_SHARING; ++i) {
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
|
|
||||||
#include "BLI_iterator.h"
|
#include "BLI_iterator.h"
|
||||||
#include "BKE_report.h"
|
#include "BKE_report.h"
|
||||||
#include "DNA_object_types.h"
|
|
||||||
|
|
||||||
#include "DEG_depsgraph_build.h"
|
#include "DEG_depsgraph_build.h"
|
||||||
#include "DEG_depsgraph_debug.h"
|
#include "DEG_depsgraph_debug.h"
|
||||||
@ -266,7 +265,7 @@ static void rna_def_depsgraph_iter(BlenderRNA *brna)
|
|||||||
prop = RNA_def_property(srna, "persistent_id", PROP_INT, PROP_NONE);
|
prop = RNA_def_property(srna, "persistent_id", PROP_INT, PROP_NONE);
|
||||||
RNA_def_property_ui_text(prop, "Persistent ID",
|
RNA_def_property_ui_text(prop, "Persistent ID",
|
||||||
"Persistent identifier for inter-frame matching of objects with motion blur");
|
"Persistent identifier for inter-frame matching of objects with motion blur");
|
||||||
RNA_def_property_array(prop, 2*MAX_DUPLI_RECUR);
|
RNA_def_property_array(prop, 2 * MAX_DUPLI_RECUR);
|
||||||
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
|
||||||
RNA_def_property_int_funcs(prop, "rna_DepsgraphIter_persistent_id_get", NULL, NULL);
|
RNA_def_property_int_funcs(prop, "rna_DepsgraphIter_persistent_id_get", NULL, NULL);
|
||||||
|
|
||||||
|
@ -37,8 +37,6 @@
|
|||||||
|
|
||||||
#ifdef RNA_RUNTIME
|
#ifdef RNA_RUNTIME
|
||||||
|
|
||||||
#include "DNA_object_types.h"
|
|
||||||
|
|
||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
|
|
||||||
#include "BKE_main.h"
|
#include "BKE_main.h"
|
||||||
@ -47,7 +45,6 @@
|
|||||||
#include "DNA_object_types.h"
|
#include "DNA_object_types.h"
|
||||||
|
|
||||||
#include "WM_api.h"
|
#include "WM_api.h"
|
||||||
#include "WM_types.h"
|
|
||||||
|
|
||||||
static void rna_LightProbe_recalc(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
static void rna_LightProbe_recalc(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
|
@ -1865,13 +1865,13 @@ void RNA_def_material(BlenderRNA *brna)
|
|||||||
|
|
||||||
prop = RNA_def_property(srna, "transparent_hide_backside", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "transparent_hide_backside", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "blend_flag", MA_BL_HIDE_BACKSIDE);
|
RNA_def_property_boolean_sdna(prop, NULL, "blend_flag", MA_BL_HIDE_BACKSIDE);
|
||||||
RNA_def_property_ui_text(prop, "Hide Backside" , "Limit transparency to a single layer "
|
RNA_def_property_ui_text(prop, "Hide Backside", "Limit transparency to a single layer "
|
||||||
"(avoids transparency sorting problems)");
|
"(avoids transparency sorting problems)");
|
||||||
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
|
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "use_screen_refraction", PROP_BOOLEAN, PROP_NONE);
|
prop = RNA_def_property(srna, "use_screen_refraction", PROP_BOOLEAN, PROP_NONE);
|
||||||
RNA_def_property_boolean_sdna(prop, NULL, "blend_flag", MA_BL_SS_REFRACTION);
|
RNA_def_property_boolean_sdna(prop, NULL, "blend_flag", MA_BL_SS_REFRACTION);
|
||||||
RNA_def_property_ui_text(prop, "Screen Space Refraction" , "Use raytraced screen space refractions");
|
RNA_def_property_ui_text(prop, "Screen Space Refraction", "Use raytraced screen space refractions");
|
||||||
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
|
RNA_def_property_update(prop, 0, "rna_Material_draw_update");
|
||||||
|
|
||||||
prop = RNA_def_property(srna, "refraction_depth", PROP_FLOAT, PROP_DISTANCE);
|
prop = RNA_def_property(srna, "refraction_depth", PROP_FLOAT, PROP_DISTANCE);
|
||||||
|
@ -111,13 +111,13 @@ static void rna_Object_select_set(Object *ob, bContext *C, ReportList *reports,
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 1: /* DESELECT */
|
case 1: /* DESELECT */
|
||||||
base->flag &= ~BASE_SELECTED;
|
base->flag &= ~BASE_SELECTED;
|
||||||
break;
|
break;
|
||||||
case 0: /* SELECT */
|
case 0: /* SELECT */
|
||||||
default:
|
default:
|
||||||
BKE_scene_layer_base_select(sl, base);
|
BKE_scene_layer_base_select(sl, base);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -401,7 +401,7 @@ static PointerRNA rna_RenderEngine_scene_layer_get(PointerRNA *ptr)
|
|||||||
{
|
{
|
||||||
RenderEngine *engine = (RenderEngine *)ptr->data;
|
RenderEngine *engine = (RenderEngine *)ptr->data;
|
||||||
if (engine->re != NULL) {
|
if (engine->re != NULL) {
|
||||||
SceneLayer* scene_layer = RE_engine_get_scene_layer(engine->re);
|
SceneLayer *scene_layer = RE_engine_get_scene_layer(engine->re);
|
||||||
return rna_pointer_inherit_refine(ptr, &RNA_SceneLayer, scene_layer);
|
return rna_pointer_inherit_refine(ptr, &RNA_SceneLayer, scene_layer);
|
||||||
}
|
}
|
||||||
return rna_pointer_inherit_refine(ptr, &RNA_SceneLayer, NULL);
|
return rna_pointer_inherit_refine(ptr, &RNA_SceneLayer, NULL);
|
||||||
|
@ -471,7 +471,6 @@ EnumPropertyItem rna_enum_layer_collection_mode_settings_type_items[] = {
|
|||||||
#include "BKE_node.h"
|
#include "BKE_node.h"
|
||||||
#include "BKE_pointcache.h"
|
#include "BKE_pointcache.h"
|
||||||
#include "BKE_scene.h"
|
#include "BKE_scene.h"
|
||||||
#include "BKE_idprop.h"
|
|
||||||
#include "BKE_mesh.h"
|
#include "BKE_mesh.h"
|
||||||
#include "BKE_sound.h"
|
#include "BKE_sound.h"
|
||||||
#include "BKE_screen.h"
|
#include "BKE_screen.h"
|
||||||
@ -480,9 +479,6 @@ EnumPropertyItem rna_enum_layer_collection_mode_settings_type_items[] = {
|
|||||||
#include "BKE_freestyle.h"
|
#include "BKE_freestyle.h"
|
||||||
#include "BKE_gpencil.h"
|
#include "BKE_gpencil.h"
|
||||||
|
|
||||||
#include "DEG_depsgraph.h"
|
|
||||||
#include "DEG_depsgraph_build.h"
|
|
||||||
|
|
||||||
#include "ED_info.h"
|
#include "ED_info.h"
|
||||||
#include "ED_node.h"
|
#include "ED_node.h"
|
||||||
#include "ED_view3d.h"
|
#include "ED_view3d.h"
|
||||||
@ -492,6 +488,7 @@ EnumPropertyItem rna_enum_layer_collection_mode_settings_type_items[] = {
|
|||||||
#include "ED_scene.h"
|
#include "ED_scene.h"
|
||||||
|
|
||||||
#include "DEG_depsgraph.h"
|
#include "DEG_depsgraph.h"
|
||||||
|
#include "DEG_depsgraph_build.h"
|
||||||
#include "DEG_depsgraph_query.h"
|
#include "DEG_depsgraph_query.h"
|
||||||
|
|
||||||
#ifdef WITH_FREESTYLE
|
#ifdef WITH_FREESTYLE
|
||||||
@ -2967,7 +2964,7 @@ static int rna_SceneLayer_objects_selected_skip(CollectionPropertyIterator *iter
|
|||||||
Base *base = (Base *)internal->link;
|
Base *base = (Base *)internal->link;
|
||||||
|
|
||||||
if ((base->flag & BASE_SELECTED) != 0) {
|
if ((base->flag & BASE_SELECTED) != 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
|
|
||||||
#include "rna_internal.h"
|
#include "rna_internal.h"
|
||||||
|
|
||||||
#include "WM_api.h"
|
|
||||||
#include "WM_types.h"
|
#include "WM_types.h"
|
||||||
|
|
||||||
#ifdef RNA_RUNTIME
|
#ifdef RNA_RUNTIME
|
||||||
@ -53,7 +52,6 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "WM_api.h"
|
#include "WM_api.h"
|
||||||
#include "WM_types.h"
|
|
||||||
|
|
||||||
#include "DNA_workspace_types.h"
|
#include "DNA_workspace_types.h"
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ void RNA_api_manipulator(StructRNA *srna)
|
|||||||
func = RNA_def_function(srna, "target_set_operator", "rna_manipulator_target_set_operator");
|
func = RNA_def_function(srna, "target_set_operator", "rna_manipulator_target_set_operator");
|
||||||
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
||||||
RNA_def_function_ui_description(
|
RNA_def_function_ui_description(
|
||||||
func,"Operator to run when activating the manipulator "
|
func, "Operator to run when activating the manipulator "
|
||||||
"(overrides property targets)");
|
"(overrides property targets)");
|
||||||
parm = RNA_def_string(func, "operator", NULL, 0, "", "Target operator");
|
parm = RNA_def_string(func, "operator", NULL, 0, "", "Target operator");
|
||||||
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __GWN_PY_API__
|
#ifndef __GWN_PY_API_H__
|
||||||
#define __GWN_PY_API__
|
#define __GWN_PY_API_H__
|
||||||
|
|
||||||
/** \file blender/python/gawain/gwn_py_api.h
|
/** \file blender/python/gawain/gwn_py_api.h
|
||||||
* \ingroup pygawain
|
* \ingroup pygawain
|
||||||
@ -27,4 +27,4 @@
|
|||||||
|
|
||||||
PyObject *BPyInit_gawain(void);
|
PyObject *BPyInit_gawain(void);
|
||||||
|
|
||||||
#endif /* __GWN_PY_API__ */
|
#endif /* __GWN_PY_API_H__ */
|
||||||
|
@ -647,7 +647,7 @@ static PyObject *bpygwn_VertBatch_uniform_f32(BPyGwn_Batch *self, PyObject *args
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(PyTuple_GET_SIZE(args)) {
|
switch (PyTuple_GET_SIZE(args)) {
|
||||||
case 2: GWN_batch_uniform_1f(self->batch, params.id, params.values[0]); break;
|
case 2: GWN_batch_uniform_1f(self->batch, params.id, params.values[0]); break;
|
||||||
case 3: GWN_batch_uniform_2fv(self->batch, params.id, params.values); break;
|
case 3: GWN_batch_uniform_2fv(self->batch, params.id, params.values); break;
|
||||||
case 4: GWN_batch_uniform_3fv(self->batch, params.id, params.values); break;
|
case 4: GWN_batch_uniform_3fv(self->batch, params.id, params.values); break;
|
||||||
|
@ -85,13 +85,13 @@ static void wm_method_draw_stereo3d_pageflip(wmWindow *win)
|
|||||||
static GPUInterlaceShader interlace_gpu_id_from_type(eStereo3dInterlaceType interlace_type)
|
static GPUInterlaceShader interlace_gpu_id_from_type(eStereo3dInterlaceType interlace_type)
|
||||||
{
|
{
|
||||||
switch (interlace_type) {
|
switch (interlace_type) {
|
||||||
case S3D_INTERLACE_ROW:
|
case S3D_INTERLACE_ROW:
|
||||||
return GPU_SHADER_INTERLACE_ROW;
|
return GPU_SHADER_INTERLACE_ROW;
|
||||||
case S3D_INTERLACE_COLUMN:
|
case S3D_INTERLACE_COLUMN:
|
||||||
return GPU_SHADER_INTERLACE_COLUMN;
|
return GPU_SHADER_INTERLACE_COLUMN;
|
||||||
case S3D_INTERLACE_CHECKERBOARD:
|
case S3D_INTERLACE_CHECKERBOARD:
|
||||||
default:
|
default:
|
||||||
return GPU_SHADER_INTERLACE_CHECKER;
|
return GPU_SHADER_INTERLACE_CHECKER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1967,7 +1967,7 @@ void WM_window_set_active_workspace(wmWindow *win, WorkSpace *workspace)
|
|||||||
WorkSpaceLayout *WM_window_get_active_layout(const wmWindow *win)
|
WorkSpaceLayout *WM_window_get_active_layout(const wmWindow *win)
|
||||||
{
|
{
|
||||||
const WorkSpace *workspace = WM_window_get_active_workspace(win);
|
const WorkSpace *workspace = WM_window_get_active_workspace(win);
|
||||||
return (LIKELY(workspace != NULL) ? BKE_workspace_active_layout_get(win->workspace_hook): NULL);
|
return (LIKELY(workspace != NULL) ? BKE_workspace_active_layout_get(win->workspace_hook) : NULL);
|
||||||
}
|
}
|
||||||
void WM_window_set_active_layout(wmWindow *win, WorkSpace *workspace, WorkSpaceLayout *layout)
|
void WM_window_set_active_layout(wmWindow *win, WorkSpace *workspace, WorkSpaceLayout *layout)
|
||||||
{
|
{
|
||||||
|
@ -236,7 +236,7 @@ bool WM_manipulator_target_property_range_get(
|
|||||||
mpr_prop->custom_func.range_get_fn(mpr, mpr_prop, range);
|
mpr_prop->custom_func.range_get_fn(mpr, mpr_prop, range);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user