Shape key in blender - morph XMF mesh appear / disappear

SKT PORO
by SKT PORO · 23 posts
1 year ago in Basic Creator Help
Posted 1 year ago · Author
Done... this tutorial is just amazing
Posted 1 year ago
Glad you like it.

@SKT PORO


Creating the XPF morph file:

Read here: http://www.boristheengineer.co.uk/imvu/xpf_format.htm (CAL3D's XPF XML Schema)

Step 1: Save the following code as appear.xpf
Code
<HEADER MAGIC="XPF" VERSION="919" />
  <ANIMATION NUMTRACKS="1" DURATION="60.0">
    <TRACK NUMKEYFRAMES="2" MORPHNAME="appear01.Exclusive">
      <KEYFRAME TIME="0">
        <WEIGHT>0.0</WEIGHT>
      </KEYFRAME>
      <KEYFRAME TIME="1.0">
        <WEIGHT>1.0</WEIGHT>
      </KEYFRAME>
    </TRACK>
  </ANIMATION>


Look over the code. Notice how the morph name matches the morphname of our xmf. This is how the xpf and xmf communicate with each other. Notice how it has 2 frames in time, a frame at 0 seconds setting the weight (visibility) to 0.0 | 0%, and a frame at 1 second setting the weight (visibility) to 1.0 | 100%. If you want the object to slowly phase in, you can increase the time parameter of the second keyframe tag, to make the object slowly grow to full size over that many seconds.

Step 2: Find the duration parameter of the animation tag, and set it to how many seconds you want the object to be visible. Right now, I have it set to 60 seconds, for 1 minute of visibility. 1 hour would be 3600.0 seconds.

Step 3: Open the actions tab in create mode
Click the "Add" button.
add action.PNG


Step 4: Set the trigger word to word you want and set the Morph Animation to appear.xpf
action.PNG

NOTE: If the type of product you are making is furniture, then set the action type to: ROOM
If the type of product you are making is clothing or an accessory, then set the action type to: AVATAR

Step 5: Apply and save changes
Test out your new action by pressing the "Play" button, seen in the top right corner of the previous image
This should cause your box to appear on screen.

Let me know if it worked for you / if you have any questions.

Here is the fully built chkn:
box_example.chkn
Posted 1 year ago · Author
i did all you told me Don..as i see nothing change the mesh still shown as " appear action played "

so for the disappear what should i do

-- Fri Mar 17, 2023 9:43 pm --

i think the appear animation can be better tested after doing the disappear part
Posted 1 year ago
@SKT PORO


I forgot 2 steps. I added 2 steps to this post: viewtopic.php?p=176256#p176256

It works now. You can see the final chkn here: download/file.php?id=2617




Creating the second XPF morph file:

Step 1: Make a copy of appear.xpf and rename the new copy disappear.xpf

Step 2: Reverse the order of the weights. The previous order was 0.0 and then 1.0. Instead, set them to 1.0 and then 0.0. This will tell the box to shrink from 100% all the way down to 0%, at which point it will disappear.
Code
<HEADER MAGIC="XPF" VERSION="919" />
  <ANIMATION NUMTRACKS="1" DURATION="60.0">
    <TRACK NUMKEYFRAMES="2" MORPHNAME="appear01.Exclusive">
      <KEYFRAME TIME="0">
        <WEIGHT>1.0</WEIGHT>
      </KEYFRAME>
      <KEYFRAME TIME="1.0">
        <WEIGHT>0.0</WEIGHT>
      </KEYFRAME>
    </TRACK>
  </ANIMATION>


Step 3: Open the actions tab in create mode
Click the "Add" button.

Step 4: Set the trigger word to word you want and set the Morph Animation to disappear.xpf

Step 5: Apply and save changes

Here is the final chkn with both appear and disappear added to the mesh:
box_example.chkn
Posted 1 year ago · Author
can you please fix this Don

Step 5:
CTRL+H
Find: NUMINFLUENCES="1"
Replace with:??????
Replace All

-- Sun Mar 19, 2023 3:26 pm --

The box you derive it as fourniture..mine is a chair(acessory) don, still the same??
Posted 1 year ago
@SKT PORO


can you please fix this Don

Step 5:
CTRL+H
Find: NUMINFLUENCES="1"
Replace with:??????
Replace All


You replace it with nothing. We are removing the NUMINFLUENCES from the BLENDVERTEX tags, and we are not replacing it within anything but an empty blank string.

The box you derive is furniture. Mine is a chair(accessory) don, still the same?


Set the action type to AVATAR, instead of ROOM.

Also, count the number of SUBMESH tags. My example only has 1 SUBMESH tag. If you have multiple SUBMESH tags, then you have to repeat all of the steps for each SUBMESH tag.
Posted 1 year ago · Author
mine didn't work so far i do all steps..im gonna do all again
Posted 1 year ago · Author
Lol ..i did a mistake. I took the vertex tags from not the backup xmf and that's why it didn't work. Now it work like a charm ... wonderfully.

Don, thank you so much for your impressive tutorial. Now i can use the appear/disappear morph in many things.

All I ask is please don't take off this tutorial until I learn it.

Regards

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT