Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Announcements and Showcase
VMD Camera Animation Extension released. Supporting over 10000+ camera animations

sakura
Registered User
Quote
2023-03-19 10:17:08

Hello everyone!

I'm excited to bring a new extension to CopperCube!

I successfully got CopperCube to load VMD camera animations, which means there are over 10,000+ camera animations available.

I don't know if you all know the MMD (MikuMikuDance) software.

It is a freeware animation program that lets users animate and create 3D animated films, originally produced for the Vocaloid character Hatsune Miku.

It has a camera animation file in VMD format, I wrote functions for it, and now CopperCube supports loading VMD camera animations.

Here is the demo video 1:
🔎︎



sakura
Registered User
Quote
2023-03-19 10:18:06

I really spent quite a long time parsing the VMD file and adapting it to CopperCube, I hope you like it, and please follow the rules below.

Sakura Function Library Version 1.0
Copyright © 2023 Sakura

User License

Description:
This file is a function library developed and maintained by Sakura,
containing lots of useful functions and features for simplifying
and extending CopperCube.
Modification and copying of the source code is prohibited,
and the author retains the copyright.

About Distribution:
You can freely distribute the original function library files
developed by Sakura.
Please keep the ReadMe file, prohibit modifying and distributing
the modified version of the file, and prohibit copying the source code.

Rules of Use:
The function library can be used for personal and commercial projects,
but please attribute Sakura's name and come from Ambiera Forum.

Caution:
Sakura does not guarantee that the function library is completely reliable,
so please come to the Ambiera forum to give Sakura feedback if you encounter bugs.
The rules may change at any time, please refer to the latest version of
Sakura's function library ReadMe.

Final Notes:
Please be sure to follow the rules, I have spent lots of time on this function library
and failure to follow the rules may result in stopping the update.

Here is the demo video 2:
🔎︎



sakura
Registered User
Quote
2023-03-19 10:20:39

Since I added a lot of functions, I added a class called Sakura to avoid overwriting other people's functions, so if you need to call my function library, for example to play VMD camera animation, please add Sakura in front of the function name, for example Sakura.LoadVMDCamera.

Here is the demo video 3:
🔎︎



sakura
Registered User
Quote
2023-03-19 10:22:24

To use the LoadVMDCamera function, do the following:

Add Scripted behaviors to Scene -> Sakura Function Library.
Add a Simple Camera with Active checked.
Place the model on the coordinates (0,0,0) towards the +Z axis and the camera on the +Z axis towards the -Z axis.

If your model is an MMD model, set the Scale to 4.5.

After the first frame of the scene is rendered, you can use the following code to play the VMD camera animation.

var Model = ccbGetSceneNodeFromName("Model");
var Camera = ccbGetSceneNodeFromName("Camera");
var vmdData = Sakura.ReadCCBinFile(".\\VMD.ccbin");
Sakura.LoadVMDCamera(Camera, Model, 1, vmdData);


Then with your model animation playing, it is easy to achieve the following result.

Here is the demo video 4:
🔎︎



sakura
Registered User
Quote
2023-03-19 10:23:57

For VMD camera animation file, please find it on the internet by yourself, because many authors of VMD camera animation files request not to distribute it twice, you need to download it by yourself.

Then please use the bin2cc tool to convert it to ccbin file format so that you can use the ReadCCBinFile function to load it.

This tool you can get from the following URL address:
https://ambiera.com/forum.php?t=...

Here is the demo video 5:
🔎︎



sakura
Registered User
Quote
2023-03-19 10:24:41

In addition to that, I bring a lot of new functions to make it easier for you to develop games.
This is the function documentation, which is also included in ReadMe.txt.

Documentation

ReadCCBinFile(path)
Path is the ccbin file path.
The ccbin file needs to use the bin2cc tool, see the URL link:
https://ambiera.com/forum.php?t=...

ArrayToInt32(array)
Convert 4 bytes to Int32, support hex string or int array.

ArrayIndexToInt32(array,index)
Executes ArrayToInt32 from the specified position in the array.

ArrayToFloat32(array)
Convert 4 bytes to Float32, support hex string or int array.

ArrayIndexToFloat32(array,index)
Executes ArrayToFloat32 from the specified position in the array.

RadToDeg(rad)
Convert radians to degrees.

DegToRad(rad)
Convert degrees to radians.

CubicBezierCurve(point1,point2,point3,point4,time)
Using Cubic Bezier Curve, the interpolation is based on the P1-P4 coordinates, with Time as a step.
Point structure is {x:0,y:0}.
Time Range is [0-1].

GetEndPoint(startPoint,pitch,heading,distance)
Using the start point as the origin, pitching at a certain degree and heading at a certain degree, find the coordinates of the end point at a certain distance from the start point.

Point is a 3D coordinate, structure is {x:0,y:0,z:0}.
Pitch is the X-axis rotation.
heading is the Y-axis rotation.

LoadVMDCamera(cameraNode,objectNode,playSpeed,vmdData,cameraOffset)
Play the VMD camera animation.
For camera nodes and object nodes, please use ccbGetSceneNodeFromName to get them.
Usually the object node is the model.
Play speed range is [0-1]. When set to 1, this equal to the game frame rate.
VMD data please use ReadCCBinFile to read.
The camera offset is an optional parameter with the structure {x:0,y:0,z:0},
you can adjust the camera position.

StopVMDCamera()
Stops play VMD camera animation.

PauseVMDCamera(isPause)
Pause the VMD camera animation.
Setting isPause to true will pause play, setting it to false will resume play.

IsVMDCameraStop()
Return the VMD animation playing status,
true means it is playing, false means it is stopped.


When I update the function library in the future, only the latest functions will be introduced.
If you want to see the documentation of all functions, you can check the ReadMe.txt.

Here is the demo video 6:
🔎︎



sakura
Registered User
Quote
2023-03-19 10:34:18

Finally, I hope you enjoy it and please remember to check ReadMe.txt after downloading.

If you have questions, you can post them and I will reply when I have time.

Here is the demo video 7:
🔎︎


Here is the download address:
https://send.cm/d/M4yC
Password: Sakura


serge
Registered User
Quote
2023-03-19 11:52:08

Good job


Guest
Guest
Quote
2023-03-19 12:10:59

Virus-detected Chrome doesn't allow me to download the file. Also, hate the fact that you are nothing but just a braggart.
Do you know that all the functions that you are bragging about are already possible with native javascript?
So I am not going to give you a credit in my game, If I am using native javascript for functions like radian to a degree, and the degree to radian, and other functions, I can create myself.

Most of them are already more easily possible now with Just-in-case adding them as native support to CC by extending the vector class. Like he already added functions that can get the distance and do bezier curves and all.

The only thing that attracts me to the subject is Camera animations. I can only praise you for that stuff. Other than that you are just bragging, and not helping them at all the community by putting these strict license terms to the script.

If this is how license terms are done. Then from now onwards. Every single person who is using the term "var" in his code has to put this below license in his code and has to credit me. Because I have been using this in all of my code, and all of you guys are using my code.

Anybody who uses the term "var" in their scripts or code is bound to these license terms. You are not allowed to distribute your code for free, you need to keep a readme file that contains this license info. And if you use the term then you have to put this line in your credit. SCRIPT COMES FROM GUEST OF AMBIERA FORUMS.
You are not allowed to modify these lines.

LOL, putting files behind a password-protected zip, can be a reason that some file-sharing website uses cloud detection of virus and deleting the suspicious file, so if you put your file in password protection they can't read the content of the zip archive.

Also, if you go through his cc2bin tool thread, then of course he shared only the function of the code, but not the whole code that his tool uses, so the information that he provided that he open-sourced the code is false. While if he wanted he could have shared the whole source code. If anybody wanted to use the cc2bin tool, then I can create a compiled version for you guys to safely test it. So that you can prevent yourself from using a suspicious tool. or you can compile the code yourself, All you need is a visual studio, and nothing else. you need to simply copy paste the code that I will share with you and create a command line desktop app in C then you can simply drag and drop files over it. and use the .ccbin file however you want. It will be safer side to test the tool OP posted. If you are able to search and find and download a .VMD file for camera animations.

That is the only thing that makes me support this author he brought an innovative thing to make camera animations. Other than that he is just a braggart.

Anyways, thanks for your time reading this post, hope you will keep these points in mind next time you share something with the community. and your documentation is not really helpful, it would be much better if you share video tutorials or demo files.

Agent 47 in and out!!


sakura
Registered User
Quote
2023-03-19 13:21:54

I never bragged, the debug helper and plugin I released were all real and available, it's just that people didn't use them because they were worried about viruses. So I have adjusted my development direction and now only focus on making extensions based on CopperCube native JavaScript code.

I released this CopperCube extension, the archive does not contain any exe, only a JavaScript file and TXT file, there can be no virus.

It is written in native JavaScript code, please download it first before comment.

This license is free to the maximum, you just need to write my name on it. What I mean by not copying is that you can't directly copy the code in my function library, you can write your own functions or use this function library, like you said, you can implement your own radian to degree function or degree to radian function.

cc2bin tool open source code is the core code, if you know C Sharp then look at it will be able to understand, it is very simple, read the binary file after conversion to hex text only.

The content of the file is similar to 1100FF44CC66AA such that each 2 char corresponds to a byte.

I'm really grateful to @just_in_case for encouraging me to bring more interesting things to the community. At first, I may not quite understand and released something that needed exe to assist in achieving the feature, although I think it's cool.

But I've changed my ways and will continue to release extensions based on CopperCube's native code in the future, which will surely be interesting.


sakura
Registered User
Quote
2023-03-19 13:29:46

In the ccbin tools thread, @Robbo's idea is the same as mine, just stored differently, you can read the thread carefully for details.

In fact you are worried about the bin2cc tool risky, you can run it in the sandbox or virtual machine, after all, the generated ccbin format file, not exe, it is not executable, you can open it with notepad, instantly you will understand how it is, you can refer to my core code to write a tool yourself.


sakura
Registered User
Quote
2023-03-19 13:49:43

All of the functions in this function library are necessary for me to develop the VMD camera animation extension, and I had the choice to open it up for everyone in the community to use, or not. I chose the former because I thought someone might need it, and you can't just say that these functions are simple and someone or yourself can write them and say that I have these functions that are useless.


Robbo
Guest
Quote
2023-03-20 00:28:12

Frankly any improvements the better so I support Sakura if he allows direct download of the JavaScript code to allow anyone to use it in the engine as an Action or Behavior...crediting someone for their work is normal so no issues there...

Maybe one day I may need something Sakura makes so I hope he continues working with the CopperCube engine as he is clearly an experienced coder...


sakura
Registered User
Quote
2023-03-25 12:53:42

Just released the Sakura Function Library version 1.1, the parameters of LoadVMDCamera have been changed, please note that after updating the version to modify the code, please check https://ambiera.com/forum.php?t=... for details.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact