wiki.sine.space | sinespace

Difference between revisions of "Adding Poses to Furniture"

From wiki.sine.space
Jump to: navigation, search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
You will need to have Unity and the Space Editor pack installed for this tutorial.  
+
You can add poses to furniture to make the item sittable. This will add a blue arrow icon to the piece of furniture which a user can click on and then the avatar will sit on the furniture in the pose/animation you have added to it.  
  
To add poses to furniture, first select the furniture item you want to use in Unity.
 
  
==Setting Up the Item and Animation==
+
==SeatImproved Component==
  
 
Once you have the piece of furniture in the scene, click on the furniture item in the hierarchy, then click '''Create''' and choose '''Create Empty Child'''.  
 
Once you have the piece of furniture in the scene, click on the furniture item in the hierarchy, then click '''Create''' and choose '''Create Empty Child'''.  
  
[[File:Emptychild.jpg]]
+
[[File:Createemptychild.png|300px]]
  
You can rename this to 'Pose' if you wish. Making a child for this is so you can move the 'Pose' independently from the main furniture mesh to help position the avatar correctly once animation is added.  
+
You can rename this to 'Pose' or 'Seat' to make it easier. Making a child for this is so you can move the pose independently from the main furniture mesh to help position the avatar correctly once animation is added.  
  
 
With the child/Pose highlighted, click on '''Add Component''' in the Inspector window and search for '''Seat Improved'''.  
 
With the child/Pose highlighted, click on '''Add Component''' in the Inspector window and search for '''Seat Improved'''.  
Line 15: Line 14:
 
When you have added the '''Seat Improved''' component, you will see a green box show up on your furniture item and also see the Seat Improved script settings in the Inspector Window.  
 
When you have added the '''Seat Improved''' component, you will see a green box show up on your furniture item and also see the Seat Improved script settings in the Inspector Window.  
  
[[File:Untitled-2.jpg]]
+
[[File:Seatscript.png]]
  
Under the Seat Imrpoved script, you will see a few options.  
+
Under the Seat Improved script, you will see a few options.  
  
[[File:Seatsettings.jpg]]
+
*Animation
 +
*Gender-Specific Overrides
 +
*Action Tag (Optional)
 +
*Network Adjustments
 +
*Events
 +
*IK Targetting
  
*Animation- This is for general animations
+
===Animation===
*Animation Male- This is for animations specifically made for male avatars.  
+
 
*Animation Female- This is for animations specifically made for female avatars  
+
This is the slot for the animation clip you want the chair to play when an avatar sits here. You can have a static animation or a dynamic animation.
*NPC- This is for when you want an NPC to be using the furniture with no animation (statue like)
+
 
 +
===Gender-Specific Overrides===
 +
 
 +
These will override the animation clip you have placed in the Animation slot with a gender specific animation. There is a slot for male animation, female animation and also a slot for NPC. The NPC override will make the animation static.  
 +
 
 +
===Action Tag===
 +
 
 +
These are optional settings to change the location of the action tag. You can override the location here and also add a collider to hide the tag.  <span style="color:#ff0000">Note: You won't be able to see the tag in Unity. You will have to check the tag position by uploading the furniture to staging and testing it on the preview server. </span>
 +
 
 +
===Network Adjustments===
 +
 
 +
If you are placing your SeatImproved component on something that moves, e.g. a swinging chair, you will need to check the Slot ID box, and then add in a Seat Slot ID number. You can choose any number you like as long as it is unique, for example something like 403.
 +
 
 +
[[File:Seatslot.png]]
 +
 
 +
===Events===
 +
 
 +
These are optional settings where you can set up an action to activate or deactivate when the user sits down or stands up.
 +
 
 +
[[File:Events.png]]
 +
 
 +
The top two, On Stand Up and On Sit are global, so this means any action will affect all avatars including your own.
 +
The bottom two, On Player Stand Up and On Player Sit trigger locally for yourself. This is handy for HUDs, buttons and other such things. In the image above, this local event setting is being used to active the player camera to focus on the browser screen when the user sits, and switch back to normal player camera view when the user stands.
 +
 
 +
===IK Targetting===
 +
 
 +
IK targetting is used to override the default placement of the hands and feet in the animation. This is particularly useful to make sure that the avatars' feet don't go through the floor e.g, if you have placed a chair on a rock and you don't want the avatars' feet to fall through the rock.
 +
 
 +
If you want to use IK targetting, you will need to create an Empty Object. Name it with reference to the IK targetting such as LeftFoot or RightFoot e.t.c
 +
Place the empty object at roughly the same height and placement as the avatars' ankle (this will make sure that avatars' of different height don't have their feet going through the floor). Drag this empty object into the Transform box on the IK targetting.
 +
 
 +
[[File:IKtargetting.png]]
 +
 
 +
You can test the placement by clicking on the 'Play' button at the top of Unity and switch to the 'Game' tab. If the positioning is not correct, you can move the empty object until it is in the right place.
 +
 
 +
 
 +
==Adding the Animation==
  
 
For this chair, I am going to use the Animation slot as I want this to be used by both genders.  
 
For this chair, I am going to use the Animation slot as I want this to be used by both genders.  
Line 41: Line 81:
 
The animation type will want to be set to '''Humanoid'''.
 
The animation type will want to be set to '''Humanoid'''.
  
If you are setting the animation up to be used with the avatars of Space, choose '''Copy From Another Avatar''' under the Avatar Definition header.  
+
If you are setting the animation up to be used with our default avatars, choose '''Copy From Another Avatar''' under the Avatar Definition header.  
  
Go to '''Source''' and choose the fitting avatar for the animation. If you are using gender specific animations, please select the right gender from the 2015 Female and 2015 Male avatars.  
+
Go to '''Source''' and choose the fitting avatar for the animation. If you are using gender specific animations, please select the right gender from the 2015 Female and 2015 Male avatars .fbx files.  
  
 
Click '''Apply'''.
 
Click '''Apply'''.
Line 60: Line 100:
  
  
Once this is done, click on the child of the furniture (Or Pose if you renamed it), and drag the animation (Will be named Take with numbers after it) into the rightful animation slot under the Inspector Window.  
+
Once this is done, click on the child of the furniture (Or Pose if you renamed it), and drag the animation into the rightful animation slot under the Inspector Window. Remember to place the specific animations for female and male overrides if this is what you want to do.  
If you can't see the Take animation, you may need to expand the animation by clicking on the little arrow next to it in the project window.  
+
  
 
[[File:Take2.jpg]]
 
[[File:Take2.jpg]]
Line 67: Line 106:
 
After doing this, you can search for 'PlayerChar' in the search bar of your project window, and drag it into the hierarchy. You will also need to add a Plane mesh if you are using an empty scene as the player-character will fall through the ground of the Unity scene without it. To add a plane, click '''Create''' under the hierarchy and go to 3D Object and choose Plane. You will want to place this underneath the furniture you are using.
 
After doing this, you can search for 'PlayerChar' in the search bar of your project window, and drag it into the hierarchy. You will also need to add a Plane mesh if you are using an empty scene as the player-character will fall through the ground of the Unity scene without it. To add a plane, click '''Create''' under the hierarchy and go to 3D Object and choose Plane. You will want to place this underneath the furniture you are using.
  
Once this is done, you can click on the '''Play''' button at the top of the screen. This will take you to the Game tab, and you will see the Space UI, your avatar and the furniture. The furniture will have a small blue arrow on it; Click on it and your avatar will 'Sit' on the piece of furniture with the animation/pose you have chosen.  
+
Once this is done, you can click on the '''Play''' button at the top of the screen. This will take you to the Game tab, and you will see the Space UI, your avatar and the furniture. When you hover over the furniture, a hand icon will appear. (In-world, this will be a blue arrow action tag). Click on it and your avatar will 'Sit' on the piece of furniture with the animation/pose you have chosen.  
  
 
If the avatar is not in the right position, click on the Scene tab, but do NOT stop the Game. You might have to right click the Game tab to minimize it if it is maximized.  
 
If the avatar is not in the right position, click on the Scene tab, but do NOT stop the Game. You might have to right click the Game tab to minimize it if it is maximized.  
Line 75: Line 114:
 
This insures you won't lose the correct placement when you stop the Game tab.  
 
This insures you won't lose the correct placement when you stop the Game tab.  
  
 
+
[[File:Copytransform1.png]]
  
 
Stop the Game tab from running by clicking the Play button at the top of the screen. You will see that the Transform position is back to 0,0,0.  
 
Stop the Game tab from running by clicking the Play button at the top of the screen. You will see that the Transform position is back to 0,0,0.  
Line 81: Line 120:
  
 
The furniture is now set up with the animation/pose.  
 
The furniture is now set up with the animation/pose.  
You can bake this into your scene to use in your region, or you can add a virtual good script to the item and mark it as a generic item for sale in Space Store.
 
 
  
 +
==Uploading the Furniture==
 +
To upload the furniture item with the SeatImproved script, click on the parent object of the furniture item in the hierarchy, for example, a chair with the SeatImproved component on it. In the Inspector Window, click on 'Add Component' and search for 'Room Furniture'. Add this component and set it up. If you need to know how to do this, please see [[How_to_upload_items_as_furniture|here]].
 +
Once this is set up, you can then add the virtual good component to the furniture item, then drag this from the hierarchy into the project window to make a prefab.
 +
When you have made the prefab, click on it, and fill in the virtual good component. For furniture items, the Type must be set to Furniture. The category should be Furniture, then choose the appropriate category. Fill in the rest of the details on the virtual good component, then you can hit the Automatic Submission button under the Upload tab to start the process of uploading to Sinespace. You can check on the progress of your upload at curator.sine.space
  
 
{{Tutorials Navbox}}
 
{{Tutorials Navbox}}
 +
{{Creation Navbox}}

Latest revision as of 10:42, 8 January 2019

You can add poses to furniture to make the item sittable. This will add a blue arrow icon to the piece of furniture which a user can click on and then the avatar will sit on the furniture in the pose/animation you have added to it.


SeatImproved Component

Once you have the piece of furniture in the scene, click on the furniture item in the hierarchy, then click Create and choose Create Empty Child.

Createemptychild.png

You can rename this to 'Pose' or 'Seat' to make it easier. Making a child for this is so you can move the pose independently from the main furniture mesh to help position the avatar correctly once animation is added.

With the child/Pose highlighted, click on Add Component in the Inspector window and search for Seat Improved.

When you have added the Seat Improved component, you will see a green box show up on your furniture item and also see the Seat Improved script settings in the Inspector Window.

Seatscript.png

Under the Seat Improved script, you will see a few options.

  • Animation
  • Gender-Specific Overrides
  • Action Tag (Optional)
  • Network Adjustments
  • Events
  • IK Targetting

Animation

This is the slot for the animation clip you want the chair to play when an avatar sits here. You can have a static animation or a dynamic animation.

Gender-Specific Overrides

These will override the animation clip you have placed in the Animation slot with a gender specific animation. There is a slot for male animation, female animation and also a slot for NPC. The NPC override will make the animation static.

Action Tag

These are optional settings to change the location of the action tag. You can override the location here and also add a collider to hide the tag. Note: You won't be able to see the tag in Unity. You will have to check the tag position by uploading the furniture to staging and testing it on the preview server.

Network Adjustments

If you are placing your SeatImproved component on something that moves, e.g. a swinging chair, you will need to check the Slot ID box, and then add in a Seat Slot ID number. You can choose any number you like as long as it is unique, for example something like 403.

Seatslot.png

Events

These are optional settings where you can set up an action to activate or deactivate when the user sits down or stands up.

Events.png

The top two, On Stand Up and On Sit are global, so this means any action will affect all avatars including your own. The bottom two, On Player Stand Up and On Player Sit trigger locally for yourself. This is handy for HUDs, buttons and other such things. In the image above, this local event setting is being used to active the player camera to focus on the browser screen when the user sits, and switch back to normal player camera view when the user stands.

IK Targetting

IK targetting is used to override the default placement of the hands and feet in the animation. This is particularly useful to make sure that the avatars' feet don't go through the floor e.g, if you have placed a chair on a rock and you don't want the avatars' feet to fall through the rock.

If you want to use IK targetting, you will need to create an Empty Object. Name it with reference to the IK targetting such as LeftFoot or RightFoot e.t.c Place the empty object at roughly the same height and placement as the avatars' ankle (this will make sure that avatars' of different height don't have their feet going through the floor). Drag this empty object into the Transform box on the IK targetting.

IKtargetting.png

You can test the placement by clicking on the 'Play' button at the top of Unity and switch to the 'Game' tab. If the positioning is not correct, you can move the empty object until it is in the right place.


Adding the Animation

For this chair, I am going to use the Animation slot as I want this to be used by both genders.

Find an animation you want to use for the pose that your avatar will use on the chair.

Once you have the animation, click on it in the Project window. It's Import settings will be shown in the Inspector Window.

Animationimport2.jpg

Under the Rig tab, there will be a couple of sub headers:

  • Animation Type
  • Avatar Definition
  • Source

The animation type will want to be set to Humanoid.

If you are setting the animation up to be used with our default avatars, choose Copy From Another Avatar under the Avatar Definition header.

Go to Source and choose the fitting avatar for the animation. If you are using gender specific animations, please select the right gender from the 2015 Female and 2015 Male avatars .fbx files.

Click Apply.

Rigsettings2.jpg


Go to the Animation tab and scroll down to Motion. You want to set this to None so you can independently move the avatar when playing the animation under the Game tab.

Click Apply.

Animationtab2.jpg

Testing And Finalizing the Animation

Once this is done, click on the child of the furniture (Or Pose if you renamed it), and drag the animation into the rightful animation slot under the Inspector Window. Remember to place the specific animations for female and male overrides if this is what you want to do.

Take2.jpg

After doing this, you can search for 'PlayerChar' in the search bar of your project window, and drag it into the hierarchy. You will also need to add a Plane mesh if you are using an empty scene as the player-character will fall through the ground of the Unity scene without it. To add a plane, click Create under the hierarchy and go to 3D Object and choose Plane. You will want to place this underneath the furniture you are using.

Once this is done, you can click on the Play button at the top of the screen. This will take you to the Game tab, and you will see the Space UI, your avatar and the furniture. When you hover over the furniture, a hand icon will appear. (In-world, this will be a blue arrow action tag). Click on it and your avatar will 'Sit' on the piece of furniture with the animation/pose you have chosen.

If the avatar is not in the right position, click on the Scene tab, but do NOT stop the Game. You might have to right click the Game tab to minimize it if it is maximized. Click on the child/pose in the hierarchy. You can move your avatar along with the animation to fit the furniture properly.

Once you have moved it, you will see that the new placement is marked under the Transform header in the Inspector window. Right click the Transform header, and choose Copy. This insures you won't lose the correct placement when you stop the Game tab.

Copytransform1.png

Stop the Game tab from running by clicking the Play button at the top of the screen. You will see that the Transform position is back to 0,0,0. Right click the Transform header, and choose Paste Component Values. This will add the coordinates you copied to put the animation in the right position.

The furniture is now set up with the animation/pose.

Uploading the Furniture

To upload the furniture item with the SeatImproved script, click on the parent object of the furniture item in the hierarchy, for example, a chair with the SeatImproved component on it. In the Inspector Window, click on 'Add Component' and search for 'Room Furniture'. Add this component and set it up. If you need to know how to do this, please see here. Once this is set up, you can then add the virtual good component to the furniture item, then drag this from the hierarchy into the project window to make a prefab. When you have made the prefab, click on it, and fill in the virtual good component. For furniture items, the Type must be set to Furniture. The category should be Furniture, then choose the appropriate category. Fill in the rest of the details on the virtual good component, then you can hit the Automatic Submission button under the Upload tab to start the process of uploading to Sinespace. You can check on the progress of your upload at curator.sine.space