PDA

View Full Version : Build/Buy Mode Thumbnails + Swatches


plasticbox
26th Feb 2016, 4:45 PM
Compilation of info on thumbnails and swatches for Build/Buy mode (objects, walls, floors, fences .. everything that is not CAS).


1. How thumbnails are generated and where to find them:



Game-generated thumbnails

The MTBL resource (Cutout Info Table 0x81CA1A10 (http://forums.thesims.com/en_US/discussion/878085)) defines which part of the object the thumbnail will show. Normally the bounding box in MTBL will match the bounding box of the actual item (since you will want to show the entire object), but you can also change it in MTBL e.g. if your object is very asymmetrical and you want to move it more in the middle. Coordinates in MTBL are Z-up.

Objects with geometry states (like foods and drinks) have a ThumbnailGeometryState field in OBJD that defines which state to use for the thumbnail.

Craftable objects can have a thumbnail_material_state defined in their recipe.

For walls, fences, spandrels (possibly other types too, but not objects) the group on the CWAL/CFEN/CSPN needs to be 0x00000000 n order for the thumbnail to be generated.

Thumbnails generated this way are are saved in (Documents)/Electronic Arts/The Sims 4/localthumbcache.package so you can get them from there if you need them (e.g. to create custom thumbnails). If you edit the MTBL, you need to delete localthumbcache so that the game can regenerate the images.



Game-generated thumbnails ‒ _THM/TMLT

Seen in rugs and books, probably other flat objects too. These are taken top-down, not from the front/side like three-dimensional objects. See this post (http://modthesims.info/showthread.php?t=572176) for more info and templates you can use (you can edit _THM/TMLT in s4pe 0.4.3-beta and later). If your item contains both MTBL and these, these will take precedence.

These are also saved in localthumbcache.package.



Custom thumbnails

Four THUM resources per material variant that contain the same image in four sizes, to be used by the game for different locations in the UI (catalog preview, sim thought bubbles, sim interaction queue etc). Anything larger than that will not make your thumbnail prettier btw, it will just increase the size of your package. You only need these if you want to add a logo or something like that to your thumbnail, or e.g. for mesh overrides of Maxis items that would otherwise use the existing thumbnails from thumbnails.package (which would show the original object, not the override).

These files are a custom type of Maxis-flavoured PNG (similar to PNG but the alpha channel is different). TSRW apparently uses regular PNG (not sure if those can have an alpha channel, I've only seen them with a white background).

They normally live in the custom content package they're for.

To import/export the Maxis type in s4pe, use the "Export to PNG" / "Import from PNG" option that shows when you rightclick on the resource (or in the Resource menu).

To import/export a regular PNG, use "Export > To File" / "Import > From File".


Resource IDs + sizes in pixels -- objects:

Example is a random custom object; this is the same for all sorts of Build mode items like walls, floors, roof patterns, spandrels, railings, stairs etc:

0x3C2A8647-0x5E1ACF00-0x815F108E25E1ACF0 -- 32�32 px
0x3C2A8647-0x5E1ACF01-0x815F108E25E1ACF0 -- 64�64 px
0x3C2A8647-0x5E1ACF02-0x815F108E25E1ACF0 -- 78�78 px
0x3C2A8647-0x5E1ACF03-0x815F108E25E1ACF0 -- 116�116 px

Type: 0x3C2A8647 -- this is the type for object thumbnails and walls/floors/terrains
Group (objects): 0x5E1ACF0X -- first 7 digits are digits 10-15 of the instance; last digit 0, 1, 2, 3 determines the size
Instance: 0x815F108E25E1ACF0 -- same instance as the COBJ/OBJD for this material variant

Walls, floors, roof patterns and terrain paints seem to have group 0x0000000X (last digit works the same as above).


Resource IDs + sizes in pixels -- Maxis terrain paint:

Terrain paint has bigger thumbnails for some reason.

0x3C2A8647-0x00000000-0x000000000000E0E4 -- 32�32
0x3C2A8647-0x00000001-0x000000000000E0E4 -- 64�64
0x3C2A8647-0x00000002-0x000000000000E0E4 -- 256�256
0x3C2A8647-0x00000003-0x000000000000E0E4 -- 512�512



Maxis thumbnails

In (Program Files)/Origin Games/The Sims 4/Data/Client/thumbnails.package, thumbnails2.package (the latter only contains one set of wall thumbnails for me; YMMV).




2. CatalogGroup (aka ThumbnailIID):

Items with the same CatalogGroup will be grouped together in the same thumbnail. To change this, you can edit the CatalogGroup field in COBJ/CWAL/etc in s4pe (open package > select COBJ/CWAL/CFEN > hit "Grid" button at the bottom > type/copy/paste > Commit, save package).


3. Default thumbnail:

Which colour variant of an item will be used for the default thumbnail ( = the one that shows right when you open the catalog, before selecting anything) is determined by the second word of the instance -- the highest one is the one that the game will use as default. See also this post (http://modthesims.info/showthread.php?p=4615512#post4615512)).

To change the default thumbnail, you can renumber the one you want so it will be used as default.

Example:



Default colour variant in game:

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1606704-wall-default-before.jpg



Default colour variant in s4pe (you can tell which is which by the colour tag, or the swatch colour):

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1606705-cwal.JPG



CWAL instances, sorted by second word (highest to lowest):

0xD5F0F921-0x00000000-0xB0AE8A53FAE3C625 <-- this is the one that shows as default
0xD5F0F921-0x00000000-0xB0AE8253FAE3B8D2
0xD5F0F921-0x00000000-0xC425FA64E89490CE
0xD5F0F921-0x00000000-0xE1234E299F7BE3CF
0xD5F0F921-0x00000000-0x8DFA4DDD87CA5A53
0xD5F0F921-0x00000000-0xCAC0D7A0741B2658
0xD5F0F921-0x00000000-0x8209E4B96E6B5356
0xD5F0F921-0x00000000-0xD8ABDD8E5949E559
0xD5F0F921-0x00000000-0x9C5850B35107AFD1
0xD5F0F921-0x00000000-0xE8EC667738A3B51C



To use a specific CWAL (or COBJ etc) for the default preview, renumber it so that the second word starts with FF (or FFF, FFFF .. if necessary). For example, this is the white variant:

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1606706-cwal-white.JPG



Change the instance (doubleclick on the resource in the list):

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1606707-cwal-white-renumber.JPG

Hit OK, save package.



Default colour variant in game is now the white one:

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1606708-wall-default-after.jpg



When your catalog items (CWAL, COBJ etc) are numbered sequentially -- e.g. generated from foobar-set1, foobar-set2, foobar-set3 -- and you have no SwatchSortOrder set (see below), the default will often be the same colour variant that is listed first ( = top right) in the swatch panel; when they are numbered differently (or when you have used SwatchSortOrder to put your swatches in a different order), it may be a different one.


3. How swatches are generated:

For items that have custom swatches (e.g. with a pattern on them, like for flowery wallpapers), the swatch image is referenced in CWAL/COBJ/etc in "VarientThumbImageHash".

For items that only have colours, the colours are listed in the ColorList (hexadecimal, 0xAARRGGBB). This can have up to three entries: one entry results in a monochrome swatch, two entries are used for top and bottom half (in that order), three entries are used for top, bottom, and middle (in that order -- the second list item is colour of the bottom strip of the swatch, not of the middle).


4. Swatch Sort Order:

Determined by the SwatchColorsSortPriority field (aka SwatchSubsort) in CWAL/COBJ/etc, lowest to highest.

The in-game catalog tooltips list the swatches from top right to bottom left in vertical colums; the in-world tooltips go from top left to bottom right in horizontal rows:

http://thumbs2.modthesims2.com/img/1/7/8/2/8/2/MTS_plasticbox-1606712-swatchsort.jpg