Well, we should at least be able to animate dwarves that happen to be in the middle of workshops. Pretty unambiguous, that case.
For some workshops but it will depend if they have specific tiles in them that we can fix on with 100% certainty every frame?
Ironically the dwarf himself will be obscuring the centre tile that identifies a lot of workshops!
Will we limited to checking immediately adjacent tiles or can we look farther afield?
You can check as far afield as you like, of what's currently being displayed. There are memory bandwidth and cache limits, but you probably won't ever see them; you're more likely to hit cycle limits, with if statements and such. Try not to use those.
Custom workshops wouldn't have the problem you mentioned, and it seems pretty reasonable to think that most workshops will become custom eventually.
Hm. I could also add in a feedback texture, to let you store a bit of data between frames, but.. we'll see how it works without that first, 'kay?
This would be used for...?
For example, storing the amount of time a dwarf has been standing in a workshop (so the animations don't all match up, and he doesn't start in the middle of the animation cycle when he first enters it), or to deal with the aforementioned problem by remembering what tile
was under the dwarf. Though that might be troublesome and glitchy to do.