Is there any way to export MovieTexture via API?
Read the ClassDatabaseFile (I think there aren't many changes for MovieTextures, so it's only about Unity4/5), search the MovieTexture type in it using the type id (0x98), create an AssetTypeTemplateField (AssetTypeClass.h) and call FromClassDatabase with fieldIndex 0.
To heavily reduce the memory and computing overhead, I recommend to change the m_MovieData array type to TypelessData :
Code:
for (DWORD i = 0; i < templateBase.childrenCount; i++)
{
if (!strcmp(templateBase.children[i].name, "m_MovieData") && templateBase.children[i].childrenCount > 0)
{
templateBase.children[i].children[0].type = "TypelessData";
break;
}
}
You'll need to store a pointer to the template field in a variable and create an AssetTypeInstance with baseFieldCount = 1, ppBaseFields = &<template field pointer>, reader/readerPar = <your asset reader/readerPar>, filePos = <in .assets file the absolute position of the asset>.
Then, call GetBaseField() and if it doesn't return NULL, continue. In this code sample, the returned value is stored in pBase :
Code:
AssetTypeValueField *pNameField = pBase->Get("m_Name");
AssetTypeValueField *pAudioClipFileIDField = pBase->Get("m_AudioClip")->Get("m_FileID");
AssetTypeValueField *pAudioClipPathIDField = pBase->Get("m_AudioClip")->Get("m_PathID");
AssetTypeValueField *pMovieDataField = pBase->Get("m_MovieData")->Get(0UL);
if (!pNameField->IsDummy() && !pAudioClipFileIDField->IsDummy() && !pAudioClipPathIDField->IsDummy() && !pMovieDataField->IsDummy())
{ /*do what you want with the data*/
If you changed the type to TypelessData, pMovieDataField->GetValue()->AsByteArray() will return a struct pointer with size and data variables, otherwise you'd have to get the array size via pMovieDataField->GetValue()->AsArray()->size and call (BYTE)pMovieDataField->Get(i)->GetValue()->AsInt() for each byte to generate a buffer.
This data is a .ogv file which many players support. Usually, you don't have to care for the audio data. In all cases I've seen, the audio data is inside the .ogv file.
wait, what are you talking about? it is about 7dtd ? what is it MovieTexture ?
7dtd doesn't make use of MovieTextures (afaik) but it should be usable inside a mod, also with SDX.
MovieTextures contain video and audio data and are sometimes used for cutscenes in other Unity games, I'm not sure whether they also are used ingame.