I'm trying to write a script to export an animated mesh to a text file to import into a game.
From reading the posts and scripts people had kindly shown here and the info in the FragmotionType library I've got as far as getting to print the correct Frames, Frame Rate, number of Mats used, Animation name but just canot get anywhere with getting the Path of the Texture using GetTextureByPaths.
I'm very new to this so its probably a silly error and my lack of understanding of lua scripting - so far its been a lot of trial and error, copying and a pasting etc, but has its rewarding moments when it works.

Any help or comments pointers in right direction, would be a great help.
Script so far - along way to go

--Start Script
editChar:ClearOutput(); --Clear the output window
local pAnim = IUserObject(editChar:GetSelAnimation()); --get pointer to the selected animation (IAnimation)
if (pAnim:isSet()) then -- if there is an anim currently selected
local num1 = pAnim.NumFrames;
print("frames ".. num1 .."f");
local num2 = pAnim.FPS;
pAnim.FPS = num2;
print("framerate "..num2);
local mod = editChar:GetModel();
local t = mod:TextureCount();
print("MATS "..t );
local dwAnimID = pAnim:GetName();
print(dwAnimID)
local map1 = IUserObject(editChar:GetModel());
local map2 = map1:GetTextureByPath();
print(map2)
end