Cleanup: Fix wrong formatting
For unknown reasons, visual studio unformat a section of the code.
This commit is contained in:
parent
bece863ecb
commit
b4b8d3ab0e
Notes:
blender-bot
2023-06-12 00:52:52 +02:00
Referenced by issue #56340, crash when clicking on Transform, Grab, Rotate, or Scale icon button on the left tool bar Referenced by issue #56343, 2.8/2.79 Bug: Glare Effect in Compositing Not Working with Transparency in Cycles/Eevee Referenced by issue #56330, Opening a file or clciking on the toolbar crashes blender instantly Referenced by issue #56011, Crash dragging Cursor tool and hitting S (scale)
|
@ -1200,91 +1200,91 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene
|
|||
ToolSettings *ts = scene->toolsettings;
|
||||
bGPDframe *derived_gpf = NULL;
|
||||
const bool main_onion = v3d != NULL ? ((v3d->gp_flag & V3D_GP_SHOW_ONION_SKIN) == 0) : true;
|
||||
const bool no_onion = (bool)(gpd->flag & GP_DATA_STROKE_WEIGHTMODE) || main_onion;
|
||||
const bool overlay = v3d != NULL ? (bool)((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) : true;
|
||||
const bool no_onion = (bool)(gpd->flag & GP_DATA_STROKE_WEIGHTMODE) || main_onion;
|
||||
const bool overlay = v3d != NULL ? (bool)((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) : true;
|
||||
|
||||
/* check if playing animation */
|
||||
bool playing = stl->storage->is_playing;
|
||||
/* check if playing animation */
|
||||
bool playing = stl->storage->is_playing;
|
||||
|
||||
GpencilBatchCache *cache = gpencil_batch_cache_get(ob, cfra_eval);
|
||||
cache->cache_idx = 0;
|
||||
GpencilBatchCache *cache = gpencil_batch_cache_get(ob, cfra_eval);
|
||||
cache->cache_idx = 0;
|
||||
|
||||
/* init general modifiers data */
|
||||
if (!stl->storage->simplify_modif) {
|
||||
if ((cache->is_dirty) && (ob->greasepencil_modifiers.first)) {
|
||||
BKE_gpencil_lattice_init(ob);
|
||||
}
|
||||
}
|
||||
/* draw normal strokes */
|
||||
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
|
||||
/* don't draw layer if hidden */
|
||||
if (gpl->flag & GP_LAYER_HIDE)
|
||||
continue;
|
||||
|
||||
bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, cfra_eval, 0);
|
||||
if (gpf == NULL)
|
||||
continue;
|
||||
|
||||
/* create GHash if need */
|
||||
if (gpl->runtime.derived_data == NULL) {
|
||||
gpl->runtime.derived_data = (GHash *)BLI_ghash_str_new(gpl->info);
|
||||
}
|
||||
|
||||
if (BLI_ghash_haskey(gpl->runtime.derived_data, ob->id.name)) {
|
||||
derived_gpf = BLI_ghash_lookup(gpl->runtime.derived_data, ob->id.name);
|
||||
}
|
||||
else {
|
||||
derived_gpf = NULL;
|
||||
}
|
||||
|
||||
if (derived_gpf == NULL) {
|
||||
cache->is_dirty = true;
|
||||
}
|
||||
if (cache->is_dirty) {
|
||||
if (derived_gpf != NULL) {
|
||||
/* first clear temp data */
|
||||
if (BLI_ghash_haskey(gpl->runtime.derived_data, ob->id.name)) {
|
||||
BLI_ghash_remove(gpl->runtime.derived_data, ob->id.name, NULL, NULL);
|
||||
}
|
||||
|
||||
BKE_gpencil_free_frame_runtime_data(derived_gpf);
|
||||
/* init general modifiers data */
|
||||
if (!stl->storage->simplify_modif) {
|
||||
if ((cache->is_dirty) && (ob->greasepencil_modifiers.first)) {
|
||||
BKE_gpencil_lattice_init(ob);
|
||||
}
|
||||
/* create new data */
|
||||
derived_gpf = BKE_gpencil_frame_duplicate(gpf);
|
||||
if (!BLI_ghash_haskey(gpl->runtime.derived_data, ob->id.name)) {
|
||||
BLI_ghash_insert(gpl->runtime.derived_data, ob->id.name, derived_gpf);
|
||||
}
|
||||
/* draw normal strokes */
|
||||
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
|
||||
/* don't draw layer if hidden */
|
||||
if (gpl->flag & GP_LAYER_HIDE)
|
||||
continue;
|
||||
|
||||
bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, cfra_eval, 0);
|
||||
if (gpf == NULL)
|
||||
continue;
|
||||
|
||||
/* create GHash if need */
|
||||
if (gpl->runtime.derived_data == NULL) {
|
||||
gpl->runtime.derived_data = (GHash *)BLI_ghash_str_new(gpl->info);
|
||||
}
|
||||
|
||||
if (BLI_ghash_haskey(gpl->runtime.derived_data, ob->id.name)) {
|
||||
derived_gpf = BLI_ghash_lookup(gpl->runtime.derived_data, ob->id.name);
|
||||
}
|
||||
else {
|
||||
BLI_ghash_reinsert(gpl->runtime.derived_data, ob->id.name, derived_gpf, NULL, NULL);
|
||||
derived_gpf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* draw onion skins */
|
||||
if ((gpd->flag & GP_DATA_SHOW_ONIONSKINS) &&
|
||||
(!no_onion) && (overlay) &&
|
||||
(gpl->onion_flag & GP_LAYER_ONIONSKIN) &&
|
||||
((!playing) || (gpd->onion_flag & GP_ONION_GHOST_ALWAYS)))
|
||||
{
|
||||
if ((!stl->storage->is_render) ||
|
||||
((stl->storage->is_render) && (gpd->onion_flag & GP_ONION_GHOST_ALWAYS)))
|
||||
if (derived_gpf == NULL) {
|
||||
cache->is_dirty = true;
|
||||
}
|
||||
if (cache->is_dirty) {
|
||||
if (derived_gpf != NULL) {
|
||||
/* first clear temp data */
|
||||
if (BLI_ghash_haskey(gpl->runtime.derived_data, ob->id.name)) {
|
||||
BLI_ghash_remove(gpl->runtime.derived_data, ob->id.name, NULL, NULL);
|
||||
}
|
||||
|
||||
BKE_gpencil_free_frame_runtime_data(derived_gpf);
|
||||
}
|
||||
/* create new data */
|
||||
derived_gpf = BKE_gpencil_frame_duplicate(gpf);
|
||||
if (!BLI_ghash_haskey(gpl->runtime.derived_data, ob->id.name)) {
|
||||
BLI_ghash_insert(gpl->runtime.derived_data, ob->id.name, derived_gpf);
|
||||
}
|
||||
else {
|
||||
BLI_ghash_reinsert(gpl->runtime.derived_data, ob->id.name, derived_gpf, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* draw onion skins */
|
||||
if ((gpd->flag & GP_DATA_SHOW_ONIONSKINS) &&
|
||||
(!no_onion) && (overlay) &&
|
||||
(gpl->onion_flag & GP_LAYER_ONIONSKIN) &&
|
||||
((!playing) || (gpd->onion_flag & GP_ONION_GHOST_ALWAYS)))
|
||||
{
|
||||
gpencil_draw_onionskins(cache, e_data, vedata, ob, gpd, gpl, gpf);
|
||||
if ((!stl->storage->is_render) ||
|
||||
((stl->storage->is_render) && (gpd->onion_flag & GP_ONION_GHOST_ALWAYS)))
|
||||
{
|
||||
gpencil_draw_onionskins(cache, e_data, vedata, ob, gpd, gpl, gpf);
|
||||
}
|
||||
}
|
||||
|
||||
/* draw normal strokes */
|
||||
gpencil_draw_strokes(
|
||||
cache, e_data, vedata, ts, ob, gpd, gpl, gpf, derived_gpf,
|
||||
gpl->opacity, gpl->tintcolor, false);
|
||||
|
||||
}
|
||||
|
||||
/* draw normal strokes */
|
||||
gpencil_draw_strokes(
|
||||
cache, e_data, vedata, ts, ob, gpd, gpl, gpf, derived_gpf,
|
||||
gpl->opacity, gpl->tintcolor, false);
|
||||
/* clear any lattice data */
|
||||
if ((cache->is_dirty) && (ob->greasepencil_modifiers.first)) {
|
||||
BKE_gpencil_lattice_clear(ob);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* clear any lattice data */
|
||||
if ((cache->is_dirty) && (ob->greasepencil_modifiers.first)) {
|
||||
BKE_gpencil_lattice_clear(ob);
|
||||
}
|
||||
|
||||
cache->is_dirty = false;
|
||||
cache->is_dirty = false;
|
||||
}
|
||||
|
||||
/* Helper for gpencil_instance_modifiers()
|
||||
|
|
Loading…
Reference in New Issue