Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-11-25 17:07:12 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-11-25 17:07:12 +0300
commitfffce6c5545c3072d2dd266dfe5c133b760baebe (patch)
tree025256e7bc4caa09ae6df3f31b40d75e2c0b7e94 /source/blender/editors
parent134935a8db7fe6137bb8a508771757beeb68b2b3 (diff)
Sculpt: Multires
* Displacement coordinates are now stored differently, as a grid per face corner. This means there is duplication of coordinates, especially at low subdivision levels, but the simpler implementation justifies it I think. * ToDo: conversion of existing multires files (2.4x or 2.5x), loading them may even crash now. * Editmode preservation/interpolation code also has not been updated yet. * Multires now works on the CCGDerivedMesh grids instead of CDDerivedMesh, which should be more memory efficient. * There are still bad memory peaks (if you're using 32bit) when subdividing or propagating displacements. Though at least there should be no huge memory blocks allocated, which windows is now to have trouble with. * Still found some weird spike artifacts at lower multires levels, some also happening before this commit. Perhaps computation of tangents needs to be tweaked more. * Multires modifier now has viewport, sculpt and render levels. Also the levels have been made consistent with subsurf, previously the same level of subdivision was one less for multires. * Both multires and subsurf modifier now can have their subdivision level set to 0 for no subdivision.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/object/object_modifier.c13
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c10
2 files changed, 15 insertions, 8 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index c4304056017..9da7fa94295 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -373,7 +373,7 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi
BKE_report(reports, RPT_INFO, "Applied modifier only changed CV points, not tesselated/bevel vertices");
- if (!(md->mode&eModifierMode_Realtime) || (mti->isDisabled && mti->isDisabled(md))) {
+ if (!(md->mode&eModifierMode_Realtime) || (mti->isDisabled && mti->isDisabled(md, 0))) {
BKE_report(reports, RPT_ERROR, "Modifier is disabled, skipping apply");
return 0;
}
@@ -684,6 +684,13 @@ void OBJECT_OT_modifier_copy(wmOperatorType *ot)
/************* multires delete higher levels operator ****************/
+static int multires_poll(bContext *C)
+{
+ PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier);
+ ID *id= ptr.id.data;
+ return (ptr.data && id && !id->lib);
+}
+
static int multires_higher_levels_delete_exec(bContext *C, wmOperator *op)
{
PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier);
@@ -702,8 +709,8 @@ void OBJECT_OT_multires_higher_levels_delete(wmOperatorType *ot)
{
ot->name= "Delete Higher Levels";
ot->idname= "OBJECT_OT_multires_higher_levels_delete";
- ot->poll= ED_operator_object_active;
+ ot->poll= multires_poll;
ot->exec= multires_higher_levels_delete_exec;
/* flags */
@@ -718,7 +725,7 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op)
Object *ob= ptr.id.data;
MultiresModifierData *mmd= ptr.data;
- multiresModifier_subdivide(mmd, ob, 1, 0, mmd->simple);
+ multiresModifier_subdivide(mmd, ob, 0, mmd->simple);
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index c9e351458ad..82893b48af0 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2027,13 +2027,13 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op)
{
ToolSettings *ts = CTX_data_tool_settings(C);
Object *ob = CTX_data_active_object(C);
- //MultiresModifierData *mmd = sculpt_multires_active(ob);
+ MultiresModifierData *mmd = sculpt_multires_active(ob);
if(ob->mode & OB_MODE_SCULPT) {
multires_force_update(ob);
- /*if(mmd && mmd->sculptlvl != mmd->lvl)
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);*/
+ if(mmd && mmd->sculptlvl != mmd->lvl)
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
/* Leave sculptmode */
ob->mode &= ~OB_MODE_SCULPT;
@@ -2044,8 +2044,8 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op)
/* Enter sculptmode */
ob->mode |= OB_MODE_SCULPT;
- /*if(mmd && mmd->sculptlvl != mmd->lvl)
- DAG_id_flush_update(&ob->id, OB_RECALC_DATA);*/
+ if(mmd && mmd->sculptlvl != mmd->lvl)
+ DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
/* Create persistent sculpt mode data */
if(!ts->sculpt)