Skip to content

Animesh as a Prop

HowardBaxton edited this page Jan 25, 2023 · 8 revisions

Rez and control an Animesh Prop

NOTE: This will require you have an animesh mesh prim. If you do not have one contact Howard Baxton in world and he will send you one for this exercise.

In this exercise you will use some advanced features that nPose provides, as well as the nPose Animesh Plugin.

Set up the animesh:

Rez the animesh and edit it. In the contents tab of the edit window, add the following items:
* nPose Animesh Plugin V0.16.3
* nPose Prop Plugin V4.00
* npose-listen forward
* npose-listen left
* npose-listen right
* npose-storyteller
If you do not have these items, contact Howard Baxton in world and he will provide them to you. The alternative is to use your own poses and get the plugin from github HERE.
The animesh must have the animations it will need inside it's own contents and the animations should have at a minimum of copy permissions.
Once the animesh plugin script and animations it will need are loaded into the animesh contents, it is ready to use.

  • Take the animesh back into your inventory
  • From your inventory add the animesh to your build.
  • Make sure your build is loaded and has the following plugins as well in its contents:
    • nPose Prop Plugin V4.00
    • nPose SAT-NOTSAT Plugin V4.00

We will be using PLUGINCOMMAND. To begin with we will set up a PLUGINCOMMAND in the .init notecard of your build.
Add the following line inside your .init notecard:

  • PLUGINCOMMAND|XANI_MESH|-14002
  • Save and close the .init notecard.

Now we are ready to rez the animesh.

  • Make a notecard in your inventory and name it SET:Animesh:Rez
  • Edit the notecard and add the following lines:
    • PROP|AnimeshName|<0,0,1>|<0,0,0>
    • PROP_DO|AnimeshName|*||XANI_MESH|AnimeshName|body|npose-listen right|<0,0,1>|<0,0,0>
  • Save and close the notecard
  • Add it to your build

Now you are able to rez the prop. Click for menu and select Animesh/Rez. The animesh should rez and assume the animation named in the PROP_DO line.

Next we can adjust the position of the animesh prop.

  • Edit the animesh prop and move it to the position which suits you for this initial notecard.
  • When the animesh prop is in the correct position, you can copy the PROP line nPose sends you in local chat.
  • Replace the PROP line in the SET:Animesh:Rez notecard.
    The next time the animesh prop is rezzed, it will assume the new position.

Next we need a way to derez the animesh prop

  • Make a notecard in your inventory and name it SET:Animesh:Derez
  • Edit the notecard and add the following line:
    • PROP_DO|AnimeshName|*||DIE
  • Save and close the notecard
  • Add it to your build

Now you can click this menu button to derez the animesh prop.

What if we want to move the animesh prop and also have the animesh run a different animation?

We've seen the line which animates the animesh in the SET:Animesh:Rez notecard. We simply need to change the animation in that line and also provide a position and rotation numbers for the new position.

First lets create a new notecard and set the new animation, then we will worry about getting the new position and rotation.

  • Make a notecard in your inventory and name it SET:Animesh:Tell Story
  • Edit the new notecard and add a line as follows:
    • PROP_DO|AnimeshName|*||XANI_MESH|AnimeshName|body|npose-storyteller
  • Save and close the notecard
  • Add it to the build

Now you have another menu button to change the animesh's animation. Click it while the animesh is rezzed to assume the new animation.

Now we need to get the new position and rotation needed for this notecard. We have a couple ways we can get the new position:

  1. We can rez adjusters and position any of the adjusters to the new position to get the numbers we need.
  2. We can simply move the animesh to the new position to get the numbers we need.
    Either of these two will give you a line in local chat with the numbers we need. Copy only the position and rotation vectors and we'll add them to the line in the SET:Animesh:Tell Story notecard in the contents of the build.
  • Edit the SET:Animesh:Tell Story notecard in the contents of the build
  • At the end of the existing line we added to the contents of this notecard add a vertical bar |
  • Paste the new position and rotation numbers just following that vertical bar so it looks something like this:
    • PROP_DO|AnimeshName|*||XANI_MESH|AnimeshName|body|npose-storyteller|<0,0,0>|<0,0,0>
  • Save and close the notecard

Done. Now it should all work as planned. But we have a problem: Each time the animesh is moved to a new position, it will report the new position to us in local. This could be considered spam so we can easily stop this spamming.

  • Edit the SET:Animesh:Rez notecard in the contents of the build
  • In the PROP line we have we can simply tell the prop to be quiet so it doesn't send spam each time the prop moves by adding the following to the end of that line:
    • PROP|AnimeshName|<0,0,1>|<0,0,0>||quiet
      Add two vertical bars and the word quiet like this: ||quiet

I hope this will give you a good idea of how this all works so that you can pursue your own ideas using animesh.

If you wish to clean up the sub menu we've created follow on to UDPBOOL and Toggle Buttons.