XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Sun Dec 09, 2018 10:15 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: The incredibles: animation controller problems
PostPosted: Mon Oct 08, 2018 3:07 pm 
Offline
ultra-n00b

Joined: Thu Jun 14, 2018 12:58 am
Posts: 7
Has thanked: 0 time
Have thanks: 0 time














You can make the ads go away by registering

hi i downloaded someone script and the problem is the animation is still glitching, and i need help to stop it glitching in 3ds max. the problem is it's on the wrong side and it only works with 1 Dummy and that's it and not more so i can't see what's going on.

Code:
ClearListener()

struct AnimationAsset
(
   public BoneCount,
   public FrameCount,
   public KeyframeCount,
   public Keyframes = #(),
   public TimeMap = #(),
   public KeyframeMap = #()
)

struct Keyframe
(
    public Frame,
    public Rotation,
    public Translation
)

global glAsset = undefined
global bitConverter = dotNetClass "System.BitConverter"

rollout animLoader "animLoader"
(
   group "About"
   (
      label lab1 "ANIM Asset Importer"
      label lab2 "Script by igorseabra4"
   )
   group "Import"
   (
      button importButton "Import..."
   )
   
    function DecompressFloat compressed =
    (
        local floatInt = bit.shift (bit.and compressed 0x8000) 16
        if ((bit.and compressed 0x7fff) != 0) then
        (
            floatInt = bit.or floatInt ((bit.shift (bit.and compressed 0x7800) 12) + 0x38000000)
            floatInt = bit.or floatInt (bit.shift (bit.and compressed 0x07ff) 12)
        )

        bit.intasfloat floatInt
    )
      
   function ReadAnimationsFromFile filePath =
   (
      local reader = fopen filePath "rb"
      
      local asset = AnimationAsset()
      
      local magic = ReadLong reader
      
      local unkInt1 = ReadLong reader
      
      asset.BoneCount = ReadShort reader      
      asset.FrameCount = ReadShort reader      
      asset.KeyframeCount =  ReadLong reader
      
      local unkInt2 = ReadLong reader
      local unkInt3 = ReadLong reader
      local unkInt4 = ReadLong reader
            
      for i = 1 to asset.KeyframeCount do
      (
         local kf = Keyframe()
         
         kf.Frame = ReadShort reader
            
         local RotationX = ReadShort reader
         local RotationY = ReadShort reader
         local RotationZ = ReadShort reader
         local RotationW = ReadShort reader
         local TranslationX = ReadShort reader
         local TranslationY = ReadShort reader
         local TranslationZ = ReadShort reader
         
         kf.Rotation = quat (DecompressFloat(RotationX)) (DecompressFloat(RotationY)) (DecompressFloat(RotationZ)) (DecompressFloat(RotationW))
         kf.Translation = [ DecompressFloat(TranslationX), DecompressFloat(TranslationY), DecompressFloat(TranslationZ) ]
         
         append asset.Keyframes kf
      )
      
      for i = 1 to asset.FrameCount do
      (
         append asset.TimeMap (ReadFloat reader)
      )
      
      for i = 1 to (asset.FrameCount - 1) do
      (
         local frameList = #()
         
         for j = 1 to asset.BoneCount do
         (
            local frameIndex = ReadShort reader            
            append framelist frameIndex
         )
         
         append asset.KeyframeMap framelist
      )
      
      fclose reader
      
      glAsset = asset
   )
   
    function TraverseNode curNode &nodes =
    (
        append nodes curNode
        for childNode in curNode.Children do
            TraverseNode childNode &nodes
    )
   
    function GetAnimationNodes =
    (      
        local nodes = #()
       
        if ( nodes.Count == 0 ) then
        (
            local animRootNode = GetNodeByName "Dummy002"
         
           
            TraverseNode animRootNode &nodes
        )
       
        return nodes
    )
   
    function LoadAnimation =
   (
      local mAnimationNodes = GetAnimationNodes()
      
      animationRange = interval 0 (glAsset.FrameCount)
      
      with animate on
      (
         for frameIndex = 1 to (glAsset.FrameCount - 1) do
         (
            local keyframeList = glAsset.KeyframeMap[frameIndex]
            for boneIndex = 1 to glAsset.BoneCount do
            (
               local keyframeIndex = keyframeList[boneIndex] + 1
               local kf = glAsset.Keyframes[keyframeIndex]
               at time (kf.Frame)
               (
                  mAnimationNodes[boneIndex].Controller.Rotation = kf.Rotation
                  mAnimationNodes[boneIndex].Controller.Position = kf.Translation
               )
            )
         )
      )
   )

   on importButton pressed do
   (
      local filePath = getOpenFileName caption:"Import VColor OBJ" \
               types:"All Files (*.*)|*.*|"
   
      ReadAnimationsFromFile(filePath)
      LoadAnimation()
   )
)

createDialog animLoader 160 160
so something happening to this https://gyazo.com/1ef12d671a2cc0b8547e16e710b89dd4


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: The incredibles: animation controller problems
PostPosted: Sat Oct 13, 2018 10:34 pm 
Offline
ultra-n00b

Joined: Thu Jun 14, 2018 12:58 am
Posts: 7
Has thanked: 0 time
Have thanks: 0 time
So i tried compressing it and it does not get the same size as the original model while using the animation controller, i typed in ckf.RotationX and other ckf and typed in ckf next to decompressfloats and it still give me a codeblock, which i want to get the original same size as the model as that animation controller that file format. but the thing is the bones are messed up it's going on the wrong coordinates and it's stretching out and it's going on the x axis which i want it to stand still and do it's animation pose. so i need help to get it fix. like all i want to do is get the same size without the vertices stretching apart, without the bones stretching apart. so can someone help me please. :(


Top
 Profile  
 
 Post subject: Re: The incredibles: animation controller problems
PostPosted: Sat Oct 13, 2018 11:24 pm 
Offline
ultra-n00b

Joined: Thu Jun 14, 2018 12:58 am
Posts: 7
Has thanked: 0 time
Have thanks: 0 time
THAT'S IT, NOBODY NOT GOING TO HELP ME!!!!!!!!!!!!!!!!!!!!!!!!!!! :x


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Durik256, jooped, Shinshila, Über Winfrey and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group