Swapping Graphics Resources
Importing graphics from one object into another

Importing graphics from one object into another solves several problems. Here Madoria wants to merge new function with old graphics. This method can also be used to change the number of rotations an object has (1,2 or 4) and brings the X/Y coordinates along with the graphics saving you the trouble of having to reposition.

Madoria writes:

     Raeven , is it hard to apt hack a Fridge ?
     I really want to make my Plum Fridge apt hacked, you see....

Fridges are harder to apartment hack, yes. Since they create (I always say "spawn") foods you have to go through and change all of the food references from Maxis' to Simlogical's hacked foods as well as the normal apartment hacking.

Cloning an apartment hacked fridge and putting your graphics on it would actually be easier.

Step 1 - Clone an OBJECT and open it in IffPencil.

In this case you'll be cloning an apartment hacked fridge.

Step 2 - Delete the old graphic resources in your new clone.

Highlight all of the DRGP, all of the SPR2 and all of the PALT resources and delete those.

When you first open the object "all resources" will be highlighted so the list in the main window will be quite long. You can pick through it, finding all of the graphic resources (hold CTRL down to make multiple selections and then Del button on keyboard) but I tend to find it a little easier to click DRGP in the left hand window. This act as as a filter, filtering all other resources out of the main window so only the DRGP resources show in the right. I can then highlight all of those and delete them and then do the same with the PALT and the SPR2. All three of those resources should drop out of the list altogether.

This step is needed because Iffpencil sometimes has a hard time overwriting resources and you get much better results by deleting the old instead of trying to write over them.

Step 3 - Import the graphics resources from your "source" object.

In this case your source object is your Plum Fridge.
  1. Ctrl + I to import (or right-click in an empty space in the main window and pick Import from the menu) and choose the second option ("Import one or more IFF files with resources").
  2. Find your "source object" with replacement graphics you want (Plum fridge) and choose it.
  3. By default all of it's resources are selected which is not what you want. You just want all of it's DRGP PALT and SPR2 so skim down the list until you find the first one of those and click it. It'll be the only one highlighted now. Hold CTRL for multiple selection and choose the rest of the DRGP, PALT and SPR2 resources from your plum fridge.
  4. When you have all of them selected hit OK. If it asks about overwriting something that is NOT a DRGP PALT or SPR2 say no. It means you've highlighted something by accident that you should not have.

Step 4 - Make sure the NEW OBJECT knows how to find the new graphics.

  1. Open your Plum fridge in IffPencil. I find it easier to actually open a second instance of IffPencil and load the object into that. This way you can have them side by side.
  2. Open the OBJD resource ( Madoria writes: click on it! and a little pop up window will open) of both fridges so you can compare the two and look for the line that says "Base Graphic ID #". Make sure your Clone has the same number your Plum fridge does.
  3. Then scroll down and "Dynamic sprite base ID #" and again make sure the clone has the same number as the Plum fridge.
  4. "OK" out of the OBJD editor.

Step 5 - A quick last check that all graphic resources were imported.

While you have them both open in iffpencil go ahead and double check that in the list (in the left hand window frame) of resource types that you got all of the graphics resources. The number in the parenthesis next to each resource type tell you how many are there so DRGP (6) means you have 6 drawgroups. The Plum fridge has 6 and so should the clone Check the PALT and SPR2 resources match up as well.

Save and test.

Author: Raeven

More sites with information on working with graphics resources:

Secret Society of Woobsha - Graphics Swapping with IFF Snooper
Teaches how to swap graphics resources on a Mac

Sims College - IHL4 : Part 1 - Graphic States, Sprites & Draw Groups
Teaches swapping the graphics resources using Iffpencil instead of editing the XML

Secret Society of Woobsha - Tutorial : Illuminating Sprites
Making objects with glow in the dark parts; Iffpencil tutorial also touches on how DRGP and SPR2 resources work and work together.

Real Sims - Tutorial : Adding Sprite Rotations to an object
Teaches swapping the graphics resources using Iffpencil instead of editing the XML

C & C Enterprises - Tutorial : Lovebed Tutorial
(Download found in the do it yourself section)