There are a couple of ways depending on your player character setup.
If class based as in each player character having their own weapon set it’s common practice to included the weapons rigging as part of the main character and do the animations up as a single package. You can then add all of your character parts and weapons as a single character blueprint and turn on and off “use in game” as needed.
If the player character needs to access weapons via inventory then the weapons would need to be separated into individual packages and the animations introduced to the main player animations via a weapons BP that would contain the required assets to animate the player character based on weapon selection.
Did a behind the scenes video on the development of our core weapons development as a primer.
Sorry if it’s wordy but tried to include as much logic in one go.
The animation of the weapon is the easy part but where it has to go and how it needs to work determines how the animations needs to be authored so the destination of the required animations for a given weapon is not as part of the player character package or animation blueprint assigned to the character model but to a weapons blueprint that once a given weapon is selected the information necessary to make all things functional comes from a weapons BP instance.
The logic behind the design what is required as to the needs of a unique weapons requirements is cast to as to animations for 1st,3rd and weapon animations as well as hit specs and sounds as well as effects.
Don’t know if you have this need sorted but needs to be mentioned as to where the stuff you make needs to go.
The animation part is actually easy no mater what app you use for authoring and since I use Motion Builder
Start by importing a character proxy and the desired weapon. I’ll then add a point helper to the local snap of the weapon so that I can snap the weapon back to it’s origin so I can export the animation in it’s proper world position.
That’s the set up.
I’ll then snap the weapon to the gun_ik and “link constraint” the weapon to the gun_ik. It’s important to use a link constraint and not a common link Once done I’ll animate both the character and weapon so both match up as authored.
Once I’m happy I’ll break the link constraint and snap the weapon back to origin and export the animation via FBX and by selection.
As for something like spinning a valve it could be done as a procedural event but as an animator I find life is easier if everything that moves is keep with in the same development channel. No disrespect but animated assets always look better than coded procedural solutions.