Quick Reply
Search this Thread
Imagine Wonderfully!
staff: trainee moderator
Original Poster
#1 Old 13th Jun 2022 at 12:36 AM Last edited by TheSweetSimmer : 13th Jun 2022 at 1:12 AM.
Default Tutorial: How to position/animate props in an animation CLIP
This tutorial will show you how to position and/or animate props (including babies) that are parented to a Sim or other object, and will explain necessary information about Parents Events.

Requirements:
  • Blender 3D
  • Sim rigs and required plugins
  • S3PE and required wrappers/addons
  • S3OC to export the prop(s)
It's recommended you also have a basic understanding of Blender, S3PE and S3OC as well as modding. This tutorial will not cover how to set up any of the programs mentioned nor show how to install mods for the game.
Keep in mind this tutorial does not refer to custom poses and animations used for the pose/animation player.

---

Setting up the prop in Blender

First, I should explain how props work in the game. When you add a parent event to an object, the origin of the object will be attached to the same position and rotation of the parent bone or slot mentioned in the event info. The bone used to animate/reposition an object is the transform bone (and if present a _rot bone for rotating the object).

With that said, let's get started!

Import the prop into your Blender scene, select it, then go to the object constraints tab on the right hand side (and make sure the prop is in object mode). Add a "Copy Transforms" constraint, set the target as your Sim rig and the bone as the parent bone you want. The reason why the constraint is added in object mode (to the object itself, not the rig) is to keep the local position and orientation of the prop so the root doesn't doesn't move (like it would if the constraint was added in pose mode).



Put the prop in pose mode, then select the transformBone on the prop rig, and move it to where you want it positioned.



Now just pose or animate the Sim if needed!



If you want to use a slot as the parent bone (which can be more convenient), or preview an EA animation with a prop, you will have to get the translation values of the slot on a Sim, which are found in BOND files (slot offset data in clothing/morphs/sliders). I've linked a .blend file with the positions of every slot (all ages included) as an action file that you can append into your scene. Here's a quick demonstration:

Go to File --> Append, select the .blend file then go into the "Action" folder and select "S3_slotOffsetPlacements".



Now, it will bring you back to the viewport. Select one of the slots on the Sim rig, then go to the Object Data tab, scroll down to Pose Library and select the action you just imported in, then click the age of what the Sim rig is and apply the action pose by clicking the little magnifying glass on the right hand side under the plus and minus sign.



Then you'll see the slot change it's position.



If you want all the slots offsetted, deselect everything (or select everything) and do the same explained above. Keep in mind though that it will apply the saved pose to all bones on the rig, so you'll loose the pose you had before. You can always manually select each slot though, or set up a bone group specifically for the slots so you can select them easily and then apply the pose to just them. Here's what all the slots look like in their offset positions:



Please remember! If you use a slot bone as the parent and are exporting the Sim animation too, make sure to reset the slot position back to default otherwise the position will be calculated twice in-game. The prop will be "out of place" when you do this, but it will work perfectly fine in-game because the prop rig itself is not affected. You can also duplicate the slot bone and make the original one the "fake" one to keep it's position, and the duplicated one as the original by changing the names (so duplicated one will have the original slot name, and the original one will be renamed) and then resetting the duplicated bone so you don't have to do anything else afterwards. If you're exporting just the prop animation you don't need to worry about any of this.

Once you're done, just simply export the prop (/and Sim) animation. You don't need to remove any constraints because the bone translation/orientation data will be baked automatically.

Setting up the prop in S3pe

In S3pe, all the information about the prop animation is referenced to the game through events. To add a new event, import the prop animation, select it and go to Grid --> Event Section --> and select the three dots to the right, this will bring up another data grid where you can add, copy and delete events. Add a new parent event.



The only really necessary info you need to fill in are these 5 values:




1. Timecode: is the time in seconds in which you want the event to start after the animation begins (0 means the beginning of the animation)

2. ActorNameHash: the actor of which the event will play on.

3. ObjectNameHash: the parent of the object.

4. SlotNameHash: the target bone or slot name of the parent.

5. Transform: will transform the object according to the data from the animation. Setting just the first number (00) as 1 will put the object in the correct position, though to avoid any kind of issues you can set the values 00, 05, 0A and 0F as 1. Here are a few examples with other numbers/letters changed to 1 or higher:




All the values need to be in hash code (if you don't know what the hash of an object is you can use FNV Hash tool in S3pe).

Click OK then save your package and put it in your mods folder. Now you can look at the animation(s) in-game!



In this animation, the cup is parented to the Sim's right hand slot. To showcase that you can use any bone, slot or not, here's the same cup parented to the Sim's right cheek.



I haven't tested how props work on pets, but considering the slots already have offsets on the base rig they should also work like shown on Sims in the tutorial.

Baby animations

Babies are animated the same way as props, because they're actually objects too, at least in rig form. They're parented to a Sim's right hand when they're carried (hence the old bug where sometimes they'd be attached to a Sim's hand when driving) and other slots on objects they get put into.




Extra: Multiple parent events and visibility events

Say you want to make a Sim pass one object in their hand to the other, or even to another Sim, or make the object appear and disappear! Then you'll need to add more parent events, but also make sure that the time codes are perfect because the object will snap from one frame to the next when a new parent event is activated. In Blender, you can switch the timing of an animation in seconds and not frames within the timeline (under View). It will then show each second, plus the number of frames within it (30 fps).



When you want an object to attach to another bone, simply add another "Copy Transforms" constraint, then set the influence to 0. To make it easier, go to one frame before 1 second of when you want to change the parent, then add a new keyframe to both constraints by pressing I over the influence, then on the second mark, drag the current parent constraint down to 0 and the new parent to 1. Set new keyframes if it didn't do it automatically.



If you really want a specific time for an event to start, you can change the TimeCode Style in the settings to give you exact timecodes of a frame or in-between frames. Keep in mind though if the time doesn't match up with the constraint switch then the positions of the object in-game won't match up for the amount of time between the timecode and the actual switch of parents.

In S3pe, make sure you put the same timecode in as the one in Blender.

To make an object appear or disappear, use a Visibility event. Visibility on 0 means invisible, while 1 means visible. The timecode is when the object will appear or disappear instantly, a fade-in or fade-out is done by a script event.

---

That's the end of the tutorial! If you have any questions, or need further explanation, please let me know!

Download link to .blend file https://drive.google.com/file/d/1bz...iew?usp=sharing

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Advertisement
Senior Moderator
staff: senior moderator
#2 Old 13th Jun 2022 at 4:00 PM
This is AMAZING!
I had this issue where when trying to have a prop in the sim's hand, in Blender, the hand slot would be on the sim's wrist and so it's a different position to what happens in game. But now I know it's because of that slot-offset thingy! Ah this is gonna be so helpful
Field Researcher
#3 Old 13th Jun 2022 at 7:39 PM
Wow, thank you for this! The slot offset was the solution to the main problem I was having with testing IK chains!
Forum Resident
#4 Old 13th Jun 2022 at 8:35 PM
Thank you so much for this detailed + insightful tutorial!
Senior Moderator
staff: senior moderator
#5 Old 23rd Oct 2022 at 12:33 AM
Moved to tutorials! This is a prop lifesaver by the way
Test Subject
#6 Old 19th May 2023 at 6:03 AM
I am so lost....I have attempted this several times and it never works. Can you someone help me PLEASE
Imagine Wonderfully!
staff: trainee moderator
Original Poster
#7 Old 19th May 2023 at 7:23 PM
Quote: Originally posted by S3lynn
I am so lost....I have attempted this several times and it never works. Can you someone help me PLEASE


Can you explain what's going wrong?

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Test Subject
#8 Old 19th May 2023 at 9:33 PM
Thank you so much for responding. I have created successful animations for mother and baby in Blender. With your wonderful tutorial I managed to place the baby in the proper position. Hear are my questions; in SP3E will I need to add animations for both mother and the baby or just the baby? When I load the animations and add directions to a special mod that I'm working on nothing happens. The name of the option/animation appears in the live game menu but no action takes place.

Any help you can provide would be greatly appreciated.

S3Lynn aka sms3Lynn
Imagine Wonderfully!
staff: trainee moderator
Original Poster
#9 Old 19th May 2023 at 10:53 PM
Quote: Originally posted by S3lynn
Thank you so much for responding. I have created successful animations for mother and baby in Blender. With your wonderful tutorial I managed to place the baby in the proper position. Hear are my questions; in SP3E will I need to add animations for both mother and the baby or just the baby? When I load the animations and add directions to a special mod that I'm working on nothing happens. The name of the option/animation appears in the live game menu but no action takes place.

Any help you can provide would be greatly appreciated.

S3Lynn aka sms3Lynn


If you're making a mother and baby animation then yes you will need both animations. If your sims aren't playing the animation then it's most likely something to do with your code or jazz script and not necessarily the animations themselves. Otherwise, have you double checked that the names match up and the baby has the events required to appear in the right position?

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Test Subject
#10 Old 21st May 2023 at 3:09 AM
Quote: Originally posted by TheSweetSimmer
If you're making a mother and baby animation then yes you will need both animations. If your sims aren't playing the animation then it's most likely something to do with your code or jazz script and not necessarily the animations themselves. Otherwise, have you double checked that the names match up and the baby has the events required to appear in the right position?



Thanks....did some reconfiguring and I'm trying it out as we speak! Will let you know how this works.
Field Researcher
#11 Old 14th Aug 2023 at 11:54 AM
This tutorial is amazing!

However I have run into some problems.
The prop that I want to use doesn't have a pose mode in blender. This being the grim reaper's scythe (I also tried with the pickaxe from world adventures but it didnt work either)
However, the trident prop works in blender and has a pose mode.

The scythe:


The Trident (which I accidentaly named deathscythe):



I also have an additional problem with s3pe. the grid option doesn't show up.



Is there a way to fix these problems?
Or is there some sort of workaround where I can just use my script mod to make the prop appear in the sim's hand?

I tried to do this but the scythe wouldn't appear.
Code:
ObjectGuid actorObjectId = GlobalFunctions.CreateProp("deathScythe", ProductVersion.BaseGame, Vector3.OutOfWorld, 0, Vector3.UnitZ);
                base.AcquireStateMachine("Scythe_Swing");
                base.EnterStateMachine("Scythe_Swing", "Enter", "x");
                base.SetActor("x", actor);
                base.mCurrentStateMachine.SetPropActor("scythe", actorObjectId);
                Animation.ForceAnimation(actorObjectId, true);
                base.EnterSim("Enter");
                base.AnimateSim("Animate_Sims");


Does anyone have an idea how this/these problems can be fixed?
Screenshots
Imagine Wonderfully!
staff: trainee moderator
Original Poster
#12 Old 14th Aug 2023 at 4:20 PM
@xantak22

For some objects, their rig isn't loaded when exporting it from S3OC or the data is empty. What you can do is manually look for the rig in the game files then either copy and add it to the package file of the object or if it has a rig with no data then replace it. As for the script, you can add the object in through it but you would still need to assign some animation to it unless you want it to be in it's bind pose.

You'll need the wrappers from here http://www.simlogical.com/ContentUp...s/859/index.htm to be able to access the data in the grid

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Field Researcher
#13 Old 14th Aug 2023 at 7:47 PM
Quote: Originally posted by TheSweetSimmer
@xantak22

For some objects, their rig isn't loaded when exporting it from S3OC or the data is empty. What you can do is manually look for the rig in the game files then either copy and add it to the package file of the object or if it has a rig with no data then replace it. As for the script, you can add the object in through it but you would still need to assign some animation to it unless you want it to be in it's bind pose.

You'll need the wrappers from here http://www.simlogical.com/ContentUp...s/859/index.htm to be able to access the data in the grid


Thank you som much for replying!

I definitely need to try to add the rig if that's what's missing. But since the grid option doesn't work for me in s3pe, I think I need to use a script to make the prop appear for now. It's not a problem that it's in bind pose at the moment. But my script doesn't seem to work. The animation works, but the prop doesn't show up.

Code:
ObjectGuid actorObjectId = GlobalFunctions.CreateProp("deathScythe", ProductVersion.BaseGame, Vector3.OutOfWorld, 0, Vector3.UnitZ);
                base.AcquireStateMachine("Scythe_Swing");
                base.EnterStateMachine("Scythe_Swing", "Enter", "x");
                base.SetActor("x", actor);
                base.mCurrentStateMachine.SetPropActor("scythe", actorObjectId);
                Animation.ForceAnimation(actorObjectId, true);
                base.EnterSim("Enter");
                base.AnimateSim("Animate_Sims");


Do I need to parent it to a slot, and if so, do you know how?
Imagine Wonderfully!
staff: trainee moderator
Original Poster
#14 Old 14th Aug 2023 at 8:19 PM
@xantak22

No problem! To parent it, I think this would work
Code:
actorObjectId.ParentToSlot(Actor, Actor.ContainmentSlots.LeftHand)
I'm typing from memory though so it might be something different. If it still doesn't appear try also making it visible in case it's invisible
Code:
actorObjectId.SetHiddenFlags(HiddenFlags.Nothing)

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Field Researcher
#15 Old 14th Aug 2023 at 9:00 PM Last edited by xantak22 : 14th Aug 2023 at 10:03 PM.
Quote: Originally posted by TheSweetSimmer
@xantak22

No problem! To parent it, I think this would work
Code:
actorObjectId.ParentToSlot(Actor, Actor.ContainmentSlots.LeftHand)
I'm typing from memory though so it might be something different. If it still doesn't appear try also making it visible in case it's invisible
Code:
actorObjectId.SetHiddenFlags(HiddenFlags.Nothing)


That gives me errors saying that ObjectGuid doesn't contain defenitions for ParentToSlot and SetHiddenFlags, is it because ParentToSlot and SetHiddenFlags are used for gameobjects and not props maybe? I have no idea.

Maybe I am doing wrong in trying to make the prop appear like this.
Code:
ObjectGuid actorObjectId = GlobalFunctions.CreateProp("deathScythe", ProductVersion.BaseGame, Vector3.OutOfWorld, 0, Vector3.UnitZ);

Perhaps I should use something else than ObjectGuid so that I can use ParentToSlot. Although I tried with IGameObject and it gave errors too.

I'm gonna look at the script for the woodfire oven and see if I can figure out something from there since I just realized that I think they use a similar method.

EDIT:
I looked at the woodfire oven from the sims 3 store and tried the following, but it didnt work.
Code:
ObjectGuid actorObjectId = GlobalFunctions.CreateProp("deathScythe", ProductVersion.BaseGame, Vector3.OutOfWorld, 0, Vector3.UnitZ); // try deathScythe
                Slot leftHand = Sim.ContainmentSlots.LeftHand;
                actorObjectId = Slots.GetContainedObject(actor.ObjectId, (uint)leftHand);
                ObjectGuid[] children = Slots.GetChildren(actor.ObjectId, leftHand);
                foreach (ObjectGuid objectGuid in children)
                {
                    if (objectGuid != actorObjectId)
                    {
                        GameObject @object = GameObject.GetObject(objectGuid);
                        if (@object != null)
                        {
                            @object.UnParent();
                            @object.Destroy();
                        }
                    }
                }


                base.AcquireStateMachine("Scythe_Swing");
                base.EnterStateMachine("Scythe_Swing", "Enter", "x");
                base.SetActor("x", actor);
                //base.mCurrentStateMachine.SetPropActor("scythe", actorObjectId);
                //Animation.ForceAnimation(actorObjectId, true);
                base.EnterSim("Enter");
                base.AnimateSim("Animate_Sims");


I'm running out of ideas on how to make the prop appear. What's wrong with my script? Or is there something fishy about the prop itself?
Field Researcher
#16 Old 15th Aug 2023 at 8:13 AM
Quote: Originally posted by TheSweetSimmer
@xantak22

No problem! To parent it, I think this would work
Code:
actorObjectId.ParentToSlot(Actor, Actor.ContainmentSlots.LeftHand)
I'm typing from memory though so it might be something different. If it still doesn't appear try also making it visible in case it's invisible
Code:
actorObjectId.SetHiddenFlags(HiddenFlags.Nothing)


Doing it this way got rid of the errors:
Code:
                IGameObject actorObjectId = GlobalFunctions.CreateObjectOutOfWorld("DeathScythe", ProductVersion.BaseGame);
                actorObjectId.ParentToSlot(Actor, Sim.ContainmentSlots.LeftHand);
                actorObjectId.SetHiddenFlags(HiddenFlags.Nothing);
                actorObjectId.SetOpacity(0f, 0f);


                base.AcquireStateMachine("Scythe_Swing");
                base.EnterStateMachine("Scythe_Swing", "Enter", "x");
                base.SetActor("x", actor);
                //base.mCurrentStateMachine.SetPropActor("scythe", actorObjectId);
                //Animation.ForceAnimation(actorObjectId, true);
                base.EnterSim("Enter");
                base.AnimateSim("Animate_Sims");

But the prop still doesn't appear and now my sim doesn't even perform the animation, they just get softly reset.
Any idea of what I'm doing wrong?
Imagine Wonderfully!
staff: trainee moderator
Original Poster
#17 Old 15th Aug 2023 at 6:17 PM
Quote: Originally posted by xantak22
Doing it this way got rid of the errors:
Code:
                IGameObject actorObjectId = GlobalFunctions.CreateObjectOutOfWorld("DeathScythe", ProductVersion.BaseGame);
                actorObjectId.ParentToSlot(Actor, Sim.ContainmentSlots.LeftHand);
                actorObjectId.SetHiddenFlags(HiddenFlags.Nothing);
                actorObjectId.SetOpacity(0f, 0f);


                base.AcquireStateMachine("Scythe_Swing");
                base.EnterStateMachine("Scythe_Swing", "Enter", "x");
                base.SetActor("x", actor);
                //base.mCurrentStateMachine.SetPropActor("scythe", actorObjectId);
                //Animation.ForceAnimation(actorObjectId, true);
                base.EnterSim("Enter");
                base.AnimateSim("Animate_Sims");

But the prop still doesn't appear and now my sim doesn't even perform the animation, they just get softly reset.
Any idea of what I'm doing wrong?


From the looks of it you didn't assign the Scythe as an actor. Make sure as well to assign it in the jazz script too. Try something like this

Code:
                AcquireStateMachine("Scythe_Swing"); // You don't need to add base at the beginning
                EnterStateMachine("Scythe_Swing", "Enter", "x");
                SetActor("scythe", actorObjectId); // The scythe is assigned here, as the actor (x) is already assigned with EnterStateMachine()
                // EnterSim("Enter");  ---> You don't need this either as the enter state is already declared in EnterStateMachine()
                AnimateSim("Animate_Sims");

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Field Researcher
#18 Old 15th Aug 2023 at 6:32 PM
Quote: Originally posted by TheSweetSimmer
From the looks of it you didn't assign the Scythe as an actor. Make sure as well to assign it in the jazz script too. Try something like this

Code:
                AcquireStateMachine("Scythe_Swing"); // You don't need to add base at the beginning
                EnterStateMachine("Scythe_Swing", "Enter", "x");
                SetActor("scythe", actorObjectId); // The scythe is assigned here, as the actor (x) is already assigned with EnterStateMachine()
                // EnterSim("Enter");  ---> You don't need this either as the enter state is already declared in EnterStateMachine()
                AnimateSim("Animate_Sims");


That's what I tried in the first place, but since the grid option is greyed out in sp3e I won't be able to use my jazz script to assign it an animation (I also had problems in blender with the prop I wanted). So now I just want to parent the prop to the sim's hand through a script instead, but I can't really figure out how to do it. The sim just softly resets now.
Imagine Wonderfully!
staff: trainee moderator
Original Poster
#19 Old 15th Aug 2023 at 6:36 PM
Quote: Originally posted by xantak22
That's what I tried in the first place, but since the grid option is greyed out in sp3e I won't be able to use my jazz script to assign it an animation (I also had problems in blender with the prop I wanted). So now I just want to parent the prop to the sim's hand through a script instead, but I can't really figure out how to do it. The sim just softly resets now.


Have you not installed the wrappers? You need them to be able to open the grid and access the data. I linked them in one of my posts above.

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Field Researcher
#20 Old 15th Aug 2023 at 7:07 PM Last edited by xantak22 : 18th Aug 2023 at 9:40 PM.
Quote: Originally posted by TheSweetSimmer
Have you not installed the wrappers? You need them to be able to open the grid and access the data. I linked them in one of my posts above.


Oh, I didn't know you needed them, I'll try that.



Edit: Now it works! Thank you so much for the help and this turorial, and sorry for cluttering up this thread with a billion questions...
Back to top