SetNifBlockTranslation

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Sets the XYZ translation of the specified NIF block in the calling reference's loaded 3D model.

  • The 5th argument, pcModel, is optional, and may be used when calling the function on the player. The player character has two, completely separate 3D models for 1st and 3rd person. This argument enables to explicitly target one of the models.
1	3rd Person Model
2	1st Person Model

Syntax

[help]
reference.SetNifBlockTranslation blockName:string posX:float posY:float posZ:float pcModel:1/2 

Or:

reference.SetNifTrans blockName:string posX:float posY:float posZ:float pcModel:1/2

Example

objectRef.SetNifBlockTranslation "Bucket01:0" 12 -7.4 0.8
player.SetNifBlockTranslation "##SightingNode" 25.4 0 6.25 2 

JIP PP LN

In version 57.45 and above, the following enhancements are available with the JIP PP LN plugin:

  • Sparse Node Paths: You can now specify a partial path to the node you wish to modify. This is useful for models with deeply nested structures or duplicate node names. The sparse path will search for a matching chain of node names in the model hierarchy, not just a direct name match.
  • New Mode Argument: An additional 6th argument allows you to change how the translation is applied.
mode = 0  ; relative to local (default)
mode = 1  ; additive translation
mode = 2  ; world position

JIP PP LN Example

Player.SetNifBlockTranslation "Weapon\##SightingNode" 128 0 48 1 3

This will find the "##SightingNode" under the "Weapon" node in the player's 3rd person model and move it to the world position (128, 0, 48).

Notes

  • The changes are reset once the calling reference's parent cell is reloaded, or Update3D is called on it.
  • Sparse path matching allows precise targeting of blocks in complex models and reduces errors due to duplicate block names.
  • To detect if JIP PP LN is available, use GetPluginVersion "JIP PP LN".

See Also