Page MenuHomeFeedback Tracker

selectionPosition command returns [0,0,0] for Simple Objects LODs with default syntax
Feedback, NormalPublic

Description

Recently I've ran into this issue, where I couldn't get the relative position of a selection in a Simple Object when using the default syntax. It returns [0,0,0] for all of them, but they don't have all the information that I need either.

Personally it's a blocker for me, because the algorithm that I wanted to reuse in my mod (BettIR) relies on that part working. The idea was to find the position of a particular proxy in the weapon model by spawning a simple object with the same model, getting the mentioned information from it using them for further calculations and functionalities.

If this command worked and if it returned information consistently for all selections and LODs, it would make a big difference.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
Latest
Category
Scripting
Steps To Reproduce
  1. Create a simpleobject using a weapon model using:
WEAPON_SIMPLEOBJECT = createSimpleObject [getText  (configFile >> "CfgWeapons" >> "arifle_MX_F" >> "model"), [0, 0, 0]];
  1. Confirm the list of selections:
selectionNames WEAPON_SIMPLEOBJECT;

Returns a list of selections:

["bolt","trigger","proxy:\a3\data_f\proxies\weapon_slots\muzzle.001","proxy:\a3\data_f\proxies\weapon_slots\side.001","proxy:\a3\data_f\proxies\weapon_slots\top.001","foresight","zasleh","proxy:\a3\data_f\proxies\muzzle_flash\muzzle_flash_rifle_mk20.001","backsight","safety","bolt_catch","camo1","camo2","proxy:\a3\data_f_mark\proxies\weapon_slots\underbarrel.001","proxy:\a3\data_f\proxies\weapon_slots\magazineslot.001","magazine","muzzlebrake"]
  1. Try to retrieve a location of any of the selections that are confirmed in the step 2
WEAPON_SIMPLEOBJECT selectionPosition "trigger";
WEAPON_SIMPLEOBJECT selectionPosition "magazine";
WEAPON_SIMPLEOBJECT selectionPosition "proxy:\a3\data_f\proxies\weapon_slots\side.001";

Returns [0,0,0] for each of the above

Expected outcome
Returns the actual position of the selection in model space

Additional Information

Running the above code with the alternative syntax which allows to specify the LOD returns the relative position correctly; However, LOD don't have the exact same selections (most importantly, proxies are often not present in other LODs other than the View).

Event Timeline

Vestarr created this task.May 17 2021, 11:50 AM
Vestarr renamed this task from selectionPosition command returns [0,0,0] for Simple Objects LODs to selectionPosition command returns [0,0,0] for Simple Objects LODs with default syntax.May 17 2021, 9:00 PM
Vestarr updated the task description. (Show Details)
Vestarr edited Steps To Reproduce. (Show Details)
Vestarr edited Additional Information. (Show Details)

If both commands are used with "Memory" filter, the result is ["eye","usti hlavne","konec hlavne","nabojnicestart","nabojniceend","bolt_axis","trigger_axis","foresight_axis","backsight_axis","magazine_axis","safety_axis","bolt_catch_axis","bipod"]
and every selection has position, is this what you are after?

@BIS_fnc_KK it's something, but unfortunately not quite there yet. Personally I'm after the weapon proxy positions which don't seem to be in the Memory LOD at all

BIS_fnc_KK added a comment.EditedMay 20 2021, 11:18 AM

There is a good chance you wont be able to get it, because it might not have one. If it is configured on the model level then yes otherwise no. I'm adding option to be able to select LOD by resolution so you could access all named selections, so if you wont be able to get the position after that, that would mean there isn't one.

Yeah that's understandable - they are available in the Resolution LODs for sure though, the command just wouldn't let me access it. The changes you're adding would be a perfect solution, thanks!

The selection could be available, yes, doesnt mean it will have position as well.

Yeah, that's true, but I guess that boils down to the model itself and how it's configured and how are the selections set up. In my particular example I guess I can take this bold assumption that most people will use model proxies as god intended them to be.

I used selectionPosition in the past on different models which had proxies in their LODs and had no issues whatsoever, just been lucky with the fact that the model actually had them in the LODs that I had access to.

From next DEV

allLODs command (returns array with all LODs and their resolutions)
both selectionNames and selecionPosition now support selection LOD by resolution, which could be obtained via allLODs

Documentation updated
https://community.bistudio.com/wiki/allLODs
https://community.bistudio.com/wiki/selectionPosition
https://community.bistudio.com/wiki/selectionNames
https://community.bistudio.com/wiki/LOD_resolutions

BIS_fnc_KK changed the task status from New to Feedback.May 21 2021, 8:40 PM
BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.May 21 2021, 9:22 PM
BIS_fnc_KK added a subscriber: BIS_fnc_KK.

Thanks @BIS_fnc_KK , you're the best. Looking forward to it.

dedmen added a subscriber: dedmen.Jun 3 2021, 12:20 PM

Doesn't seem fixed even after changes. But this ticket seems to be about new LOD support so the [0,0,0] issue now tracked in T158916

dedmen added a comment.Jun 3 2021, 2:13 PM

The problem was that the selections in reslod are faces (points with orientation) and faces weren't supported.
Fixed in next dev-branch