Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Timeline information #41

Open
henriquecolini opened this issue Jan 27, 2023 · 2 comments
Open

No Timeline information #41

henriquecolini opened this issue Jan 27, 2023 · 2 comments

Comments

@henriquecolini
Copy link

The current version of this crate does not support Timeline data, which would make it a valuable tool for animation. It would allow for batch exporting of animation frames, saving time and effort for games with a lot of frame-by-frame animations. The PSD file specifications indicate that Timeline information is stored at resource ID 0x0433, but it does not provide instructions on how to interpret this data. It probably wouldn't be too hard to do so.

@chinedufn
Copy link
Owner

Hey!

I'd be happy to review a PR that implements this. I'd also be more than happy to answer any questions.

@willstott101
Copy link

willstott101 commented Aug 25, 2023

I'm interested in looking into this. If anyone has some test psd files using a range of timeline features I'd appreciate a couple.

Resources

Reverse Engineered Specification (Heavily WIP)

So far I have found two Image Resource blocks given IDs in the 4000-4999 range, They both have 4byte tags on the front, so I am not sure if their rid is consistent, or if that's more of an index in the document.

mani tagged "plug-in" image resource block (id 4000)

This it quite an ad-hoc investigation

  • 4-byte tag: mani
  • Class name?: IRFR
  • 4 bytes: [0, 0, 2, 24] - possibly a byte length of some kind, it's in the right magnitude...
  • 8BIM
  • AnDs
  • i32: number of bytes to end of of Descriptor section (accounts for occasional padding after the Descriptor fields before next 8BIM)
  • i32: 16 - presumably this is the descriptor format version we see around a lot
  • i32: 1
  • i32: 0
  • ???: "\0\0null" (maybe this null is actually an OSType we don't know of yet with 0-data-length?)
  • Descriptor (DescriptorStructure::read_fields works from this cursor point)
    • Field AFSt, integer 0
    • Field FrIn, list of unnamed structs
      • Field FrID, random-seeming integer, I guess the Frame ID
      • Field FrGA, double, 90.0 for me so far
      • Field FrDl, integer, I think this the frame "delay" in centi-seconds, field omitted entirely unless you select a delay
    • Field FSts, list of structs, 1 long for me so far
      • Field LCnt, integer, 1 for me so far
      • Field FsFr, list of the frame IDs from FrIn.FrID
      • Field AFrm, integer, seems to be the same as the selected frame index in mfri
      • Field FsID, integer, always 0 for me so far
  • 8BIM
  • Roll
  • Some more bytes - so far less than 100 and a multiple of 4, not tried to understand it yet

mfri tagged "plug-in" image resource block (id 4001)

  • 4-byte tag: mfri
  • i32: 2
  • i32: 16
  • i32: number of animation frames
  • i32: zero-based index of the currently selected frame
  • i32: 1
  • 40 more bytes - so far always null

AdditionalLayerInfo block shmd

According to the forum post this is relevant to animation, Looks like similar formats to the stuff in mani. There are three sub-sections

  • mlst - this looks like a Descriptor padded similarly to the one in mani
  • mdyn - this seems to be 4 bytes... not sure what it is
  • cust - simliar header to mlst but doesn't look like a Descriptor

There appear to be three sub sections within

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants