Finding Where a Texture is Used

From The DarkMod Wiki
Jump to navigationJump to search

By Geep, 2020


Occasionally, you'd like to locate and take a look at every object in your map that has a given texture. This might be because:

  • you are thinking of replacing it with another texture, but want to inspect cases individually;
  • you are starting to work with someone's map (say, an abandoned or partial project), and when you dmap it, the console reports missing textures.

To find all instances of a texture of interest, here are two methods.

Method 1

  1. Begin with nothing in the map selected.
  2. In DR's Texture Browser/Texture, find the texture name of interest.
  3. Right-click on it and choose "Seek in Media Browser"
  4. In the main pane of Media window, the texture name should be highlighted in gray. (If not, use Method 2.)
  5. Right-click on the highlighted name (not anything in the lower pane) and choose "Select elements with this texture".
  6. How you proceed after that is up to you, and depends on whether there's just one, just a few, or lots of selected objects.

In that last case, you'll probably need to organize your review of them. For instance:

  • If map context is not important, just hide everything not selected, and as you visit each instance, hide it too.
  • If map context is important, add all the selected times to a new temporary DR Layer, and, as you visit each instance, delete it from that layer.

Method 2

Open the <fm>.map file with a text editor, and search (repeatedly) for the texture name of interest. For every hit, note the comment at the beginning of the block in which it appears, which gives either its "primitive" number or "entity" number. Record those separately.

Then, in DR, for each object of interest:

  1. Clear any previous selection.
  2. Use Map/Find Brush. Enter either the Brush number (e.g., primitive number) or Entity number, to select the item.
  3. Then the END key (shortcut for View/Camera/Center) will show it to you.

Last Thoughts

Keep in mind that different faces of a brush or entity may have different textures.