Hello,
I would greatly appreciate it if a Spark engine developer added the following method:
CoordsArray:Set(boneNum, coords)
Example usage:
This would allow Lua modders to programmatically "rearrange" models without the need to make new models and animation graphs.
An example application is moving the fingers of an exo, such as Scatter requires for his exo-shield (the fingers will fold back and emit blue light).
Another application is model-splicing. Setting the scale of a bone to zero and attaching another render model in its place allows modders to mix-and-match models. This would make a dual-claw exo possible without needing to create a new model and animation graph.
It would also allow for hiding the exo's fist for a rocket-fist mod.
An alternative to adding CoordsArray:Set, is to inform us of the FFI C-definition of the CoordsArray struct. That way we can do this:
Where "someVariableName" is the field name we need to know to initialise a CoordsArray.
Please consider this request,
Thank you,
Declan W.
P.S: Model transformation and splicing is used very frequently in Garry's Mod, namely in the Player Appearance Customizer addon. There is little, if any, affect on performance.
I would greatly appreciate it if a Spark engine developer added the following method:
CoordsArray:Set(boneNum, coords)
Example usage:
function Player:GetForbidModelCoordsUpdate()
local renderModel = self._renderModel
if renderModel ~= nil then
local boneCoords = self.boneCoords
for i = 0, boneCoords:GetSize()-1 do
local coords = boneCoords:Get(i)
coords.yAxis = coords.yAxis*math.random() -- Randomly scale each bone vertically
boneCoords:Set(i, coords)
end
RenderModel.SetBoneCoords(renderModel, boneCoords)
RenderModel.SetCoords(renderModel, self._modelCoords)
RenderModel.SetIsVisible(renderModel, self:GetIsVisible())
end
return true
end
This would allow Lua modders to programmatically "rearrange" models without the need to make new models and animation graphs.
An example application is moving the fingers of an exo, such as Scatter requires for his exo-shield (the fingers will fold back and emit blue light).
Another application is model-splicing. Setting the scale of a bone to zero and attaching another render model in its place allows modders to mix-and-match models. This would make a dual-claw exo possible without needing to create a new model and animation graph.
It would also allow for hiding the exo's fist for a rocket-fist mod.
An alternative to adding CoordsArray:Set, is to inform us of the FFI C-definition of the CoordsArray struct. That way we can do this:
local coords1 = Coords.GetIdentity()
local coords2 = Coords.GetIdentity()
local coordsArray = ffi.new("CoordsArray", { someVariableName = { coords1, coords2, ... } })
...
Where "someVariableName" is the field name we need to know to initialise a CoordsArray.
Please consider this request,
Thank you,
Declan W.
P.S: Model transformation and splicing is used very frequently in Garry's Mod, namely in the Player Appearance Customizer addon. There is little, if any, affect on performance.