TK Utilities, for TK17 7.5

A utility to organize, tag and change poses, with offline storage with preserved tags and sequences.

Install: Save Tk_Utils.exe in TK17 root directory. Other locations should work except on some portable installations.

Starting TK Utilities will not alter anything. No disk writes will be done unless you click some "Save" or "Ok" button.

======================

A xGMM/JSGME compatible mods & contents manager is included but only enabled and displayed if xGMM is properly installed.
If JSGME is installed and used, all mods must be deactivated to display the embedded mods manager.
See the xGMM documentation for more information. Info below does not include xGMM documentation.

======================

Poses are selected with mouse, with multi-select and multi-range. Use Alt+Click to select and display pose length.
Multi-select with Ctrl+Click, use Shift+Click to add/remove range to next (un)selected item.

You can also use Find and Tags to select poses, where selected poses will be sorted first.

If TKxEdit is installed, doubleclick on a pose will open it in TKxEdit.

Select sort order in Pose lists by clicking column title.

"Find" will select all poses with matching text in pose title and move to top of list. 

"Icons" will show poses in Icon view with Titles for visual selection.
Only poses with icons are be included. Title is shown under icon.
Select same way as in list view, + double-click selects all.
Mouse Right-Click anywhere will close Icon View.
Icons are re-scanned each time, large pose sets will slow down processing.

"Invert" will invert current selection.

======================
Tags managment
======================

Select tag from the list, or type a new tag name in the text box.
Multiselect tags with Ctrl-Select (Selected tags are shown in hint). Normal select or typing text will cancel multi-tag selection.

To set or clear tags on selected poses, select tags and click "Set" or "Clear".

"Select" will select all poses with current tag and move to top of list.

"Save" will save current tags to TagManager.uit for TK17 use.
"Restore" will reload TagManager.uit tags, removing all tag changes.

TAG CHANGES ARE TEMPORARY UNTIL SAVED! Temporary tags can be used for selecting files for moving.
During file move operations temp tags are removed. Save first if you want them preserved.

Tags should not be manipulated and saved with TK17 running, you may loose your changes.

======================
Move Poses
======================

Poses can be moved between 3 locations, Local (Save directory), Community (Community\PoseEdit directory) and Vault
During move, poses and icons are renamed when needed to avoid name conflict and to TK17 filename standard.
When poses are moved, related Tags and Sequences are updated to new the locations.

Moving to Vault will move poses away from TK17 while maintaining Tags and Sequences.
Only use ONE Vault location, or Sequences refering to Vault poses will loose track.
If you want to change Vault path, there should be no Sequence references. Move those poses to Local or Community first.
Use "..." to select or create path.

Poses are moved in the current sort order, and will be native order in new location.

===

"Pack Local Pose Filenames" will renumber pose filenames starting at first vacant space or PoseEdit0001. 
Related Sequences and Tags are updated.

===

"Import/Export" from Vault handles file name conflicts and Icon files, and also includes tags if available.
If exported, Tags are saved in "VaultTags.uit" which is also used during import. Any Sequences will lose track.

Use Shift-click on "Move/Copy from Remote to Vault" for Icon view with Titles instead of file names.
Only poses with icons are included. Large pose sets will take some time to process.

===

Backup files are left and not renamed or moved with pose move operations.
It is good practice to delete them regulary when not needed.

======================
Pose Tools
======================

A collection of tools to complement the TK17 pose editor.
Select poses to process and Doubleclick on function in list to run it.
Except where noted, all selected poses will be processed.

====

"Change Title" ( TK17 updates title with reload but will show old title in pose lists. )
Pose titles can be changed, single or batch.
Max length for titles in TK17 is 32 characters. Non US characters may not show as intended.

If only one file is selected, new title is applied as is.

If more than one file is selected, %1 = old title, %2 = counter, other text as is.
Search & replace support: end line with "/old/new/", multiple replacements and empty "/new/" for text removal supported.
I.e. "Pose %1 item %2/Seq//" will create title "Pose XX item 3" on third selected pose with old title "XX Seq".
A report preview showing the title changes is displayed first, close and cancel if you don't want to apply.

====

"Change Actor Count" (can be applied with TK17 running, just reload)
Change number of actors in pose. Select 1 - 3 actors.
If actors are removed, "Clean Poses" is recommended to remove unused keys. 

====

"Change Location" (can be applied with TK17 running, just reload)
Enter the new location in plain text.

====

"Change Flags" (can be applied with TK17 running, just reload)
Set or Clear pose flags. "Hip Trigger", "Head Rotation", "Breast Bounce Off" and "Hand Cuffs" can be changed.
Select Actor and flags to change.
Each flag may be On, Off or disabled (greyed). Disabled flags are left as is.

====

"Change Amplitude" (can be applied with TK17 running, just reload)
Changes movement relative to start frame on selected tracks.

Select actor, amplitude strength 1 - 25 (10=100%), interval and select track groups.
Track list will be displayed and may be edited (CSV format w. range: "1,5..9,23,50..55,66").

====

"Change Links" (can be applied with TK17 running, just reload)
NO BATCH PROCESSING, only the last selected pose is processed!

Changes body zone link. Each process can only change one link.

Select link to change. Current link data is displayed.
Change Source link zone, Target actor and/or link zone as desired.
Each source and each target zone may only have one associated link.
Many link combinations does not work and there is NO sanity checking.

====

"Change Rotation" (can be applied with TK17 running, just reload)
Rotate a pose around the Room vertical (Y) axis.
Select Actor and rotation, +- 180 deg.
Most poses will rotate ok in all angles, but on some the transition between keys
will flip and go the opposite way in some angles. Adding intermediate keys may help.

====

"Change Animation" (can be applied with TK17 running, just reload)
NO BATCH PROCESSING, only the last selected pose is processed!

"Ok" button is disabled if resulting pose will be to long (1152 frames).
If key spacing is to tight processing will abort.

Interactive poses:
Only pose tempo for entire pose can be changed. 

Animated poses:
Changes can be applied to all actors or a single actor.
For single actor processing, tracks (CSV format) may be also selected ("..." shows track groups).
Tracks not matching actor and track filter are left unchanged.
For poses with links, select all actors and tracks to maintain sync.

Pose Tempo ("Spacing") can be changed in all or part of pose. 
Set Spacing in % and frame interval to change (1 slot is 96 frames, 1 tick is 12 frames)
Interval defaults to entire pose.

Interpolation:
Make a non moving pose moving with Interpolation:
A helper to make a non moving (First and last frame identical) pose move.
Start and end frame must be different for pose Interpolation. 
In TK17 make sure first and last keyframe are full keyframes (TK17 Shift + S).
Move or change the last frame in TK17, leave all other frames.
When changing the pose, select axes you want interpolated. 
All keyframes between first and last will be changed relative to it's position between first and last.

The complete pose can be duplicated. 
All except the first frame is duplicated, set by Duplicates.
-1 will add a reversed copy of the current pose, no extrapolation, ending with the start frame.

Extrapolation:
Duplicate a short moving pose with Extrapolation:
If start and end frame are different, pose duplication may be extrapolated with axes selection.
I.e. create two moving steps and transform into a moving walk. 
First and last frame should be full keyframes.
End frame should be identical to start frame except location, unless you want extrapolated rotation or other effect.

Red/Green/Blue axes are the X/Y/Z Hip Axes on a new pose (TK Colors may be swapped by mods).

The different functions may be combined in one transformation.

====

"Frame Ins/Del" (can be applied with TK17 running, just reload)
Insert or Delete Frames (First frame is 0, 1 slot is 96 frames, 1 tick is 12 frames). 
Select actor, location and frames, + to insert, - to remove frames and select track groups (default ALL TRACKS).

====

"Swap Actors" (can be applied with TK17 running, just reload)
Swap 2 Actors. Just select actors to swap.
Poses without either selected actor are not processed.

====

"Pose Merge" (can be applied with TK17 running, just reload)
NO BATCH PROCESSING, only the last selected pose is processed!
Add all frames from other pose at the end of selected pose.
Select Actor and Pose file to add. Use "..." for file find dialog.
If links are used, they should be same or result may be unpredictable.

====

"Random Timing" (can be applied with TK17 running, just reload)
Makes random changes to timing to selected tracks. A random variation table is generated.
All selected tracks are changed using the same variation table to keep movements in sync.
Pose length is unchanged. Poses with tight key spacing may not be suited for timing change.

Select actor, timing Strength (1 - 25) and Intensity (1 - 25) and select track groups.
Track list will be displayed and may be edited.
For poses with links, select all actors and tracks to maintain sync.

====

"Random Amplitude" (can be applied with TK17 running, just reload)
Makes random changes to amplitude to frames relative to Start frame.
If Start and End frame are different, an interpolated value is used.

Select actor, timing Strength (1 - 25) and Intensity (1 - 25) and select track groups.
Track list will be displayed and may be edited.

====

"Random Add Life" (can be applied with TK17 running, just reload)
Adds small movements to selected tracks if no data is found (dead tracks).

Select actor, amplitude strength (1 - 25), Intensity (1 - 25) and select track groups.
Track list will be displayed and may be edited.

Static poses (single frame) will be extended to a 192 frame animated pose.

====

"Check Poses" (can be applied with TK17 running, just reload)
Poses often contain non initiated data from older/other versions, which may cause TK17 crashes.
This will initiate all non initiated data even if not used.
Poses created in newer versions may contain data not supported by TK17.
This prevents TK17 from opening these poses. If actors <= 3 offending data is removed.

====

"Check Orca" (can be applied with TK17 running, just reload)
Same as Check Poses, but also check and fix Orca limits, which may cause TK17 crashes.
Specific Orca tracks are checked and if breached set to 0.
If TK17 still crashes, create a blank pose and import each actor.
Only use this on poses to be used with Orca as it may change data in the the pose.

====

"Clean Poses" (can be applied with TK17 running, just reload)
Many pose keys contain the same value throughout an entire track, or data for non existing actors.
This data is redundant or unused and can be removed without any visible change to the pose.
Less redundant data can speed up loading time and use less resources.

====

"Jitter Filter" (can be applied with TK17 running, just reload)
Removes small movements in selected tracks if no large movements are found.
Select actor, amplitude strength 1 - 25, interval and select track groups.
Track list will be displayed and may be edited.

====

"Clear Tracks" (can be applied with TK17 running, just reload)
Removes data from selected actors and tracks in selected frame interval.
Select actors, track groups, start and end frame. Frame 0 can not be cleared.
Track list will be displayed and may be edited.

====

"Export Poses" (can be used with TK17 running)
Copy selected poses to remote directory, handles file name conflicts, Icon files and tags.

====

ALWAYS CHECK POSES IN TK17 AFTER PROCESSING! All Pose Tools can be applied with TK17 running!
All "Pose Tools" functions will back up poses before saving processed files.
After each process, re-load in TK17 and check, use "Revert to Backup" to restore if needed.

All backup files are left and not renamed with pose move operations.
Never use "Revert to Backup" after any pose move operations on the pose being restored.
It is good practice to delete backups regulary when not needed or when poses have been moved.

======================

All file operation are logged, with log to file option (will slow down processing).
When files are updated, old file will start with a '~' and add a '.bak' extension.
Only one single backup from last pose change is available! 

======================
Community Sequences
======================

Community sequences may be imported with associated poses. Poses are saved in Community, Sequence in Save.
Only Sequence and Pose files are handled. Outfits, Toys and other files are not included.
All Toy and Outfit file refs are removed from imported sequence.

======================
Reports & Utilities
======================

Before using reports, run the "Local Sequence Check & Fix".
This will correct any bad root path in all sequences, important for correct pose and sequences reports.
Any changes or missing pose references will be logged, and updated sequences will have a back up.

===

All reports are sent to preview window in CSV format. For better viewing, save and import or copy/paste to spreadsheet.
Preview window have system-dependent line-length limits and may wrap on very long lines.
Save to file and view in an external viewer or spreadsheet to view if lines are wrapping.
Extended pose reports include frame length and keyframe count and take much longer to generate.
If TK17 base path is changed, run the "Local Sequence Check & Fix" to correct, or Pose/Sequence cross reference will be incomplete.

===

Some Utility functions are also available.

======================

Most file move operations can not be used with TK17 running!

======================

Those not making proper Backups should not use this utility! 
This is potentially destructive beta state software.

======================

TK17 7.5 Track list w. Orca mod
	RootTranslation = 0; // Hip
	RootRotation = 1;
	BodyUpTranslation = 2;
	HandTranslationL = 3;
	HandRotationL = 4;
	HandTranslationR = 5;
	HandRotationR = 6;
	FootTranslationL = 7;
	FootRotationL = 8;
	FootTranslationR = 9;
	FootRotationR = 10;
	ElbowTranslationL = 11;
	ElbowTranslationR = 12;
	KneeTranslationL = 13;
	KneeTranslationR = 14;
	NeckJointRotation = 15;
	PenisSize = 16; 
	ShoulderRotationL = 17;
	ShoulderRotationR = 18;
	SpineHollowBack = 19;
	SpineArchedBack = 20;
	SpineHeadForward = 21;
	SpineHeadBackward = 22;
	SpineForward = 23;
	SpineBackward = 24;
	SpineBendR = 25;
	SpineBendL = 26;
	Orca_PenisBendMid = 27;
	SpineSideR = 28;
	SpineSideL = 29;
	HandThumbL = 30;
	HandFlatCloseL = 31;
	HandFlatSpreadL = 32;
	HandFinger01L = 33;
	HandFinger02L = 34;
	HandFinger03L = 35;
	HandFinger04L = 36;
	HandFinger05L = 37;
	HandThumbR = 38;
	HandFlatCloseR = 39;
	HandFlatSpreadR = 40;
	HandFinger01R = 41;
	HandFinger02R = 42;
	HandFinger03R = 43;
	HandFinger04R = 44;
	HandFinger05R = 45;
	Orca_Foot_Curve_L = 46;
	Orca_Foot_Curve_R = 47;
	SpineTwist = 48; 
	Orca_Vag_Ooze = 57;
	Orca_Lactate_R = 58;
	Orca_P_Shape = 61;
	Orca_V_Rub = 62; 
	Orca_Sniff = 65; 
	Orca_Balls_Hard = 66;
	Orca_CumShot1 = 69; 
	Orca_P_TipSize = 70;
	Orca_CumShot2 = 74; 
	Orca_Big_Toe_R = 77;
	Orca_Toes_R = 78; 
	Orca_Big_Toe_L = 81;
	Orca_Toes_L = 85; 
	Orca_Breath = 86; 
	Orca_Toy_Width = 89;
	Orca_Lactate_L = 90;
	Orca_P_Bend_Tip = 93;
	Orca_Toy_Length = 97; 
	BreastRotationL = 99;
	BreastRotationR = 100;
	TongueFront = 101;
	TongueStraight = 102;
	TongueTipUp = 103;
	TongueTipDown = 104;
	TongueTipLeft = 105;
	TongueTipRight = 106;
	Face_LUprLip_Dn = 107;
	Face_RUprLip_Dn = 108;
	Face_LUprLip_Up = 109;
	Face_RUprLip_Up = 110;
	Face_LLwrLip_Up = 111;
	Face_RLwrLip_Up = 112;
	Face_RLwrLip_Dn = 113;
	Face_LLwrLip_Dn = 114;
	Face_LNarrow = 115;
	Face_RNarrow = 116;
	Face_LSmile = 117;
	Face_RSmile = 118;
	Face_LMouth = 119;
	Face_RMouth = 120;
	Face_LFrown = 121;
	Face_RFrown = 122;
	Face_Jaw_Fwd = 123;
	Face_LJaw = 124;
	Face_RJaw = 125;
	Face_Jaw_Open = 126;
	Face_LSquint = 127;
	Face_RSquint = 128;
	Face_Brows_Squeeze = 129;
	Face_LBrow_Dn = 130;
	Face_RBrow_Dn = 131;
	Face_LBrowOut_Up = 132;
	Face_RBrowOut_Up = 133;
	Face_BrowsMid_Dn = 134;
	Face_BrowsMid_Up = 135;
	Face_LEye_Closed = 136;
	Face_REye_Closed = 137;
	Face_Default_Zero = 138;
	Orca_Butt_Rotate_L = 139;
	Orca_Butt_Rotate_R = 140;
	Orca_Anal_Ooze = 142;
	EyeTargetTranslation = 143;
	PenisRotation = 144;
	CameraTranslation = 145;
	CameraRotation = 146;
	TesticlesRotation = 149;
	SpineCluster03Translation = 150; // Vertebra 1
	SpineCluster04Translation = 151; 
	SpineCluster05Translation = 152; 
	SpineCluster06Translation = 153; 
	SpineCluster07Translation = 154; 
	SpineCluster08Translation = 155; // Vertebra 6
	HandcuffTranslationL = 156;
	HandcuffRotationL = 157;
	HandcuffTranslationR = 158;
	HandcuffRotationR = 159;
	Orca_Liquid_Range = 161;
	AnusOpen = 162;
	FreeToolTranslation = 165;
	FreeToolRotation = 166;
	VaginaOpen = 169;

