Lattice modifier+Dupligroup+Texture solid=weird result
Closed, ArchivedPublic

Description

Start blender -> del all, create Monkey and Lattice -> Ctrl+P: Set Parent To Lattice Deform -> deform Lattice to deform monkey -> select Monkey and Ctrl+G -> Move all to layer 2 -> create Empty in layer 1 and set Duplication - Group - Group -> select Empty and Sift+D move away -> turn on Texture solid -> TADA!

Same result if I use Texture draw mode or press render.
But it's ok if Lattice will be same group as the monkey has.

In upload file turn on Texture solid to see issue.


Platform:
================================
Windows 7 Home Premium x32


OpenGL:
================================
- Renderer: ATI Radeon HD 4770
- Vendor: ATI Technologies Inc.
- Version: 3.3.10244 Compatibility Profile Context


Blender:
================================
Version: 2.55.0
Revision: 33078






DEBUG:
*************************************************************************
ordered
OBLattice
OBMonkey
swin 13 added
bpy.ops.object.move_to_layer(layers=(True, False, False, False, False, False, Fa
lse, False, False, False, False, False, False, False, False, False, False, False
, False, False))
pass on evt 272 val 0
handle evt 272 win 12 op INFO_OT_reports_display_update
pass on evt 109 val 2
pass on evt 1 val 1
read file C:\Users\mirahal\Documents\untitled.blend
Version 255 sub 0

ordered
OBLattice
OBMonkey

ordered
OBLattice
OBMonkey
recalcob Monkey
recalcdata Monkey
pass on evt 272 val 0
handle evt 272 win 12 op INFO_OT_reports_display_update
pass on evt 1 val 2
pass on evt 217 val 1
pass on evt 97 val 1
handle evt 97 win 12 op WM_OT_call_menu
swin 13 added
pass on evt 217 val 2
pass on evt 97 val 2
pass on evt 272 val 0
swin 14 added
handle evt 272 win 12 op INFO_OT_reports_display_update
pass on evt 1 val 1
pass on evt 1 val 2
handle evt 0 win 12 op OBJECT_OT_add

ordered
OBEmpty
OBLattice
OBMonkey
bpy.ops.object.add(type='EMPTY', view_align=False, enter_editmode=False, locatio
n=(0, 0, 0), rotation=(0, 0, 0), layers=(True, False, False, False, False, False
, False, False, False, False, False, False, False, False, False, False, False, F
alse, False, False))
recalcob Empty
recalcdata Empty
pass on evt 272 val 0
handle evt 272 win 12 op INFO_OT_reports_display_update
pass on evt 1 val 1
pass on evt 1 val 2
pass on evt 11 val 1
handle evt 11 win 4 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 4 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 4 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 4 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 4 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 4 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 4 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 1 val 1

ordered
OBEmpty
OBLattice
OBMonkey
recalcob Empty
pass on evt 272 val 0
handle evt 272 win 4 op INFO_OT_reports_display_update
pass on evt 272 val 0
handle evt 272 win 4 op INFO_OT_reports_display_update
pass on evt 272 val 0
handle evt 272 win 4 op INFO_OT_reports_display_update
pass on evt 272 val 0
handle evt 272 win 4 op INFO_OT_reports_display_update
pass on evt 1 val 2
pass on evt 272 val 0
handle evt 272 win 4 op INFO_OT_reports_display_update
pass on evt 272 val 0
handle evt 272 win 4 op INFO_OT_reports_display_update
pass on evt 272 val 0
handle evt 272 win 4 op INFO_OT_reports_display_update
pass on evt 1 val 1
swin 13 added
pass on evt 1 val 2

ordered
OBEmpty
OBLattice
OBMonkey
recalcob Empty
pass on evt 1 val 1
swin 13 added
pass on evt 1 val 2
pass on evt 1 val 1
pass on evt 1 val 2

ordered
OBLattice
OBMonkey
OBEmpty
recalcob Empty
pass on evt 217 val 1
pass on evt 100 val 1
handle evt 100 win 12 op OBJECT_OT_duplicate_move

ordered
OBLattice
OBMonkey
OBEmpty.001
OBEmpty
recalcob Empty.001
recalcdata Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
pass on evt 217 val 2
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
pass on evt 100 val 2
recalcob Empty.001
pass on evt 2 val 1
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
pass on evt 2 val 2
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
recalcob Empty.001
pass on evt 1 val 1
bpy.ops.object.duplicate_move(OBJECT_OT_duplicate={"linked":False, "mode":1}, TR
ANSFORM_OT_translate={"value":(0, 0, 0), "constraint_axis":(False, False, False)
, "constraint_orientation":'<UNKNOWN ENUM>', "mirror":False, "proportional":'DIS
ABLED', "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "snap":Fals
e, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_no
rmal":(0, 0, 0), "release_confirm":False})
recalcob Empty.001
pass on evt 272 val 0
handle evt 272 win 12 op INFO_OT_reports_display_update
pass on evt 1 val 2
pass on evt 110 val 1
handle evt 110 win 12 op VIEW3D_OT_properties
swin 13 added
bpy.ops.view3d.properties()
pass on evt 110 val 2
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 10 val 1
handle evt 10 win 13 op VIEW2D_OT_scroll_up
bpy.ops.view2d.scroll_up(deltax=0, deltay=40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 1 val 1
handle evt 1 win 13 op VIEW2D_OT_scroller_activate
pass on evt 272 val 0
handle evt 272 win 13 op INFO_OT_reports_display_update
pass on evt 1 val 2
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 11 val 1
handle evt 11 win 13 op VIEW2D_OT_scroll_down
bpy.ops.view2d.scroll_down(deltax=0, deltay=-40)
pass on evt 272 val 0
swin 14 added
handle evt 272 win 13 op INFO_OT_reports_display_update
pass on evt 1 val 1
pass on evt 1 val 2
pass on evt 260 val 0
*************************************************************************

This is indeed very strange, assigning to myself.

Ton Roosendaal (ton) added a comment.Via Old WorldNov 18 2010, 1:54 PM

Turn on layer 2 to have the lattice shown.
On grabbing lattice, the deform has error, on ESC it returns to normal then (in texture solid).
Seems there's different derivedmesh code involved here.

This happens because the modifier is being re-calculated while the dupli-object is drawing.

Drawing a dupli-object overrides the objects matrix, so when draw_mesh_fancy() calls mesh_get_derived_final(), the modifier stack is re-evaluated with an incorrect matrix.

The mesh_get_derived_final() is recalculating the stack because the view drawing datamask changes.


Possible fixes:
- don't calculate the modifier stack on draw, better design and means we avoid future problems like this.
- make sure mesh_get_derived_final() runs before the matrix is overwritten (though not simple to know if this will be called).
- delay overwriting the object matrix (pass the matrix as an arg and always use the obmat for modifier stack).
- store a second matrix in the object or allow it to access its original matrix.

Brecht Van Lommel (brecht) added a comment.Via Old WorldNov 26 2010, 5:02 AM

The customdata mask should be computed from the open 3d views, doing derivedmesh recalculations means derivedmesh will always be computed twice, and it's not reliable because it's not done in the right dependency graph order. In 2.4x there was code to compute this customdata mask in object_handle_update, I think something similar should be added back in 2.5.

Ton Roosendaal (ton) added a comment.Via Old WorldDec 29 2010, 3:19 PM

Fix has been submitted in svn by campbell 5 days ago. Tested error file, and it goes fine now :)

Mikhail Rachinskiy (alm) added a comment.Via Old WorldDec 29 2010, 9:43 PM

5 days ago? I get 33931 revision, and the same bug. (test file -> turn on Texture solid)
Maybe Campbell fix is not what he should? :)

Mikhail Rachinskiy (alm) added a comment.Via Old WorldDec 31 2010, 10:14 AM

Hallooo? Any body? This bug is not fixed. Report must be reopen.

ronan ducluzeau (zeauro) added a comment.Via Old WorldJan 11 2011, 5:50 PM

ubuntu 10.10 64bits r34251

I don't know if it can help. Campbell seems to have identify problem.
But I am not sure if what I noticed is a well-known consequence or if it can help to precise problem.
So, I comment.
Displayed Mesh Data for every group instance correspond to what would be normal Mesh Data if Monkey was at the location of the last created instance.

fixed r34284.
there were 2 problems.
1) until recently the viewdatamask was not known when updating objects before drawing.
2) the group's recalculation flag was not applied to the objects when updating group objects, so objects outside the view were not getting updated.

fixed by making group_handle_recalc_and_update() work like how it did in 2.4x. applying the recalc flag to objects in the group.

fix was incorrect, reverted this commit, re-opening.

Note, I tested in 2.4x again and found it is actually broken there as well, (before I tested in 2.4x and it seemed to work ok).

Note, quite sure we relied on this bug for durian so sintels hair would be evaluated in dupli-space.

Ton Roosendaal (ton) added a comment.Via Old WorldMar 9 2011, 3:49 PM

I'm now confused... what's the status?

Ill try explain the problem as I understand it
* when an object is in a dupli-group its matrix is overwritten, the modifier stack gets built while the dupli transform is applied.
* This becomes unreliable if the object is in the viewport more then once since in that case the first drawn object has _its_ transformation space used for the modifier stack.
* When there are 2 or more duplis of the same mesh there is no right way to go about this, the first one's space is used.
* When the object is directly included in the scene as well as a dupli, the worldspace transform is used and the dupli takes on this EXCEPT when the object is not visible. This is the bug which is described.


I think the best way to deal with this is to add in logic which calculates the modifier stack for objects which are in the scene in worldspace even if they are first drawn as a dupli and are on a hidden layer, otherwise we get this problem where changing layers changes the modifier transform.
This could be done in 2 obvious ways
1) When drawing objects, even if the object is on hidden layer add ability to know if the object is drawn later as a dupli and calculate its modifier stack anyway (though its hard to know what _will_ be drawn later)

2) When drawing duplis tag objects which are directly in the scene and use this tag to known when to use the original worldspace matrix for calculating the modifier (This is more realistic however the objects currently don't store their original worldspace matrix, the duplis do but this can be changed and its simpler then option 1 still).

Ton Roosendaal (ton) added a comment.Via Old WorldJun 19 2011, 1:32 PM

Are we just trying to patch design troubles now?

One way to look at this: it seems the way ob-dupli is overwriting matrices is the bad thing; we might better have a real depsgraph (scene graph) holding such local storage by default.

The other way is that apperently textured draw is going via a different route, and could be fixed up?

>>> ob-dupli is overwriting matrices is the bad thing
Agree, though we did make use of it for sintel when the sim could run on the dupli transformaion, but we should really have some better method to get the same results.

>>> apperently textured draw is going via a different route,
its not, the change of draw mode just triggers a modifier recalc because the existing derived mesh has no UV coordinates since they were not required on solid mode.

Sergey Sharybin (sergey) added a comment.Via Old WorldApr 3 2012, 2:58 PM

Might i ask about status of this issue?

Thomas Dinges (dingto) added a comment.Via Old WorldSep 24 2012, 8:43 PM

Any updates here?

Ton Roosendaal (ton) added a comment.Via Old WorldOct 21 2012, 1:12 PM

I suggest we give up on this to work well. It's a design issue that shows the weakness of blender handles display data for duplicated objects.
Best I can do is to add this report as a reference to the list of issues that have to be solved by the "Depsgraph" recode project.

http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/Animation#Dependency_Graph

Ton Roosendaal (ton) closed this task as "Archived".Via Old WorldOct 21 2012, 1:12 PM

Add Comment