Page MenuHome

Duplicating an object with Displace modifier does not increase the reference count of the texture
Closed, ResolvedPublic

Description

--- Operating System, Graphics card ---
Windows 7 64-bit Service Pack 1, Mobile Intel 4 Series Express Chipset

--- Blender version with error, and version that worked ---
Error:
* Blender 2.67b 64-bit (official binary)
* Blender r57293 64-bit (http://builder.blender.org/download/blender-2.67-r57293-win64.zip)
Working: none I know of

--- Short description of error ---
When a mesh object with a Displace modifier is duplicated with the Duplicate Objects command (Shift+D), the reference count of the texture used in the Displace modifier is not increased although the texture is referred to by the modifiers of both the original object and the duplicated object.

--- Steps for others to reproduce the error (preferably based on attached .blend file) ---
1. Load the factory settings.
2. Add a Displace modifier to the default Cube object.
3. In the Modifier tab, click New under label “Texture:” to create a new texture (named Texture by default).
4. Duplicate Cube by pressing Shift+D (named Cube.001 by default), and place it anywhere.
5. Observe that the reference count of Texture is 1, not 2, despite the fact it is referred to by both the original Cube and Cube.001.

The following steps are optional.
6. Unlink the texture from the Displace modifier of Cube.001 by clicking the X button on the right of Texture in the Modifier tab.
7. Select Cube. Observe that the texture used in the Displace modifier of Cube is shown as red (because it refers to a texture whose reference count is 0).
8. Open the system console window, and unlink the texture from the Displace modifier of Cube. An error message “ID user decrement error: TETexture” is shown in the system console.

Notes:
* I am reporting this because an incorrect reference count seems like a Bad Thing, but I do not know if it can cause any real harm such as a wrong rendering result or a crash.
* I cannot attach a blend file which shows the issue because if I save a blend file at any point after step 4 and load it, the issue does not occur.

Event Timeline

Yuck, confirmed!
Actually, there are more issues with textures and modifiers, collected so far:
* The "show texture in texture tab" button does not show up until you have "manually" done that yourself!
* The texture count is not decreased when the modifier is deleted.

Let's give a nice easy one to Sergey :)

Fixed in svn rev57354. Thanks for the report, closing.

Sergey Sharybin (sergey) changed the task status from Unknown Status to Resolved.Jun 10 2013, 4:04 PM

Thanks! I cannot test the fix for now because I am waiting for the Windows build on builder.blender.org to be updated, but did you have a chance to also fix the issue
> * The "show texture in texture tab" button does not show up until you have "manually" done that yourself!
mentioned in the first comment?

Verified in r57476 that the bug about incrementing and decrementing the reference count was fixed. For the remaining issue about the “show texture in texture tab” button, I submitted [#35769].