Using transform functions with custom data

Hi!
I’m trying to understand the tool/gizmo code by making a transform tool for sculpt mode.
As a starting point, I would like to reuse the same transform gizmo and operator keymap from the regular transform tool. Let’s say I have a mat4 in SculptSession representing the pivot point of the transform. Is there a way to transform that matrix using the same functions defined in transform.h (like transformEvent(), transformApply()…)?
Thank you.

2 Likes

Currently there isn’t a field that’s used for this.

You could start by decomposing the matrix and transforming a location, scale & quaternion (see TransDataExtension and instances of TD_USEQUAT),
this can be converted back into a matrix after transforming.