TroyT 6 Posted July 28, 2021 I've seen a few topics regarding this but none of them solve the issue so I'm starting from scratch. I'm attempting to use hidden selections to assign textures and rvmat's to several models. The textures assign as they should but the rvmat files do not. I've confirmed that the rvmat's work by assigning them within the p3d. I've combed through dozens of BI and 3rd party mods to see how they use "hiddenSelectionsMaterials[]=" but see no difference in how I'm doing it. A test item looks like this: model.cfg: Spoiler class CfgSkeletons { class Default { isDiscrete = 1; skeletonInherit = ""; skeletonBones[] = {}; }; class BSF_Texture_Calibration_Bones: Default { skeletonInherit = "Default"; skeletonBones[] = {}; }; }; class CfgModels { class Default { sectionsInherit = ""; sections[] = {}; skeletonName = ""; }; class BSF_Texture_Calibration: Default { sectionsInherit = ""; sections[] = {"camo"}; skeletonName = "BSF_Texture_Calibration_Bones"; }; }; config.bin Spoiler class CfgVehicles { class BSF_Texture_Calibration: Exile_Construction_Abstract_Static { scope=2; model="\BSF_Community_Addon\addons\BSF_IronWall\Test_Obj\BSF_Texture_Calibration.p3d"; hiddenSelections[]= {"camo"}; hiddenSelectionsTextures[]= {"\BSF_Community_Addon\addons\BSF_IronWall\Test_Obj\BSF_Texture_Calibration_CO.paa"}; hiddenSelectionsMaterials[]= {"\BSF_Community_Addon\addons\BSF_IronWall\Test_Obj\BSF_Texture_Calibration.rvmat","\BSF_Community_Addon\addons\BSF_IronWall\Test_Obj\BSF_Texture_Calibration.rvmat"}; displayName="BSF Texture Calibration"; armor=1000; }; }; rvmat: Spoiler ambient[]={1,1,1,1}; diffuse[]={1,1,1,1}; forcedDiffuse[]={0,0,0,0}; emmisive[]={0,0,0,1}; specular[]={0.250000,0.250000,0.250000,1}; specularPower=30; PixelShaderID="Super"; VertexShaderID="Super"; class Stage1 { texture="BSF_Community_Addon\addons\BSF_IronWall\Test_Obj\BSF_Texture_Calibration_NOHQ.paa"; uvSource="tex"; class uvTransform { aside[]={1,0,0}; up[]={0,1,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; class Stage2 { texture="#(argb,8,8,3)color(0.8,0.8,0.8,0)"; uvSource="tex"; class uvTransform { aside[]={0,1,0}; up[]={-1,0,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; class Stage3 { texture="#(argb,8,8,3)color(0,0,0,0,MC)"; uvSource="tex"; class uvTransform { aside[]={1,0,0}; up[]={0,1,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; class Stage4 { texture="BSF_Community_Addon\addons\BSF_IronWall\Test_Obj\BSF_Texture_Calibration_AS.paa"; uvSource="tex"; class uvTransform { aside[]={1,0,0}; up[]={0,1,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; class Stage5 { texture="BSF_Community_Addon\addons\BSF_IronWall\Test_Obj\BSF_Texture_Calibration_SMDI.paa"; uvSource="tex"; class uvTransform { aside[]={1,0,0}; up[]={0,1,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; class Stage6 { texture="#(ai,32,128,1)fresnel(1.51,1.58)"; uvSource="tex"; class uvTransform { aside[]={1,0,0}; up[]={0,1,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; class Stage7 { texture = "a3\data_f\env_land_co.paa"; uvSource="tex"; class uvTransform { aside[]={1,0,0}; up[]={0,1,0}; dir[]={0,0,0}; pos[]={0,0,0}; }; }; The p3d has a camo selection on a single res LOD. Download p3d HERE Object when using hidden selections: With texture and rvmat assigned in p3d: Is there something in the model.cfg file that needs to be added for the material selection? Share this post Link to post Share on other sites
reyhard 2082 Posted July 28, 2021 How do you test it in game? By packing addon? By default, if RVMAT is not referenced by P3D, it will be not copied over to the PBO. Depending on tool you are using for packing you might need to add RVMATs to include list (Addon Builder) or remove them from exclude least (PBO Project) Share this post Link to post Share on other sites
TroyT 6 Posted July 28, 2021 I pack it with PBO Project into its destination addon folder. The rvmat files aren't being excluded in PBO Project. I've confirmed this by cracking it open after packing. Share this post Link to post Share on other sites
TroyT 6 Posted July 28, 2021 Interestingly enough, if I log the model info in the Editor the rvmat is listed: Spoiler NAME: BSF Texture Calibration CLASS: BSF_Texture_Calibration VEHICLE CLASS: ExileConstructions KIND OF: N/A SIZE (Width, Length, Height): [5.64672,0.778131,0.651131] SELECTION NAMES: camo PARENTS: ["BSF_Texture_Calibration","Exile_Construction_Abstract_Static","NonStrategic","Building","Static","All"] MODEL INFO: ["bsf_texture_calibration.p3d","bsf_community_addon\addons\bsf_ironwall\test_obj\bsf_texture_calibration.p3d",true] OBJECT TYPE: 8 - TypeVehicle - Some entity added by game MATERIALS: ["bsf_community_addon\addons\bsf_ironwall\test_obj\bsf_texture_calibration.rvmat"] TEXTURES: ["bsf_community_addon\addons\bsf_ironwall\test_obj\bsf_texture_calibration_co.paa"] ANIMATION NAMES: [] Also, this isn't an isolated case. This behavior persists through about 50 models that I recently converted to use hidden selections. During my research on the topic, I found many cases of other modders running into the same issue. I'm planning to release a large update with several new variants of each and the idea of having a separate model for each one would probably kill my interest in it. Since we see its use throughout A3 configs, it seems that it must be useable. Share this post Link to post Share on other sites
TroyT 6 Posted July 29, 2021 18 hours ago, reyhard said: How do you test it in game? By packing addon? By default, if RVMAT is not referenced by P3D, it will be not copied over to the PBO. Depending on tool you are using for packing you might need to add RVMATs to include list (Addon Builder) or remove them from exclude least (PBO Project) reyhard, do you have access to an unbinarized model that uses "hiddenSelectionsMaterials[]=" in its config? I'm curious if there's something in the model.cfg or in the LODs that needs to be in place for this to work. I, obviously, am coming at that end blind since I only have access to the binarized models without the model.cfg. I could provide a list of models if that would help. Share this post Link to post Share on other sites
TroyT 6 Posted July 29, 2021 Ok, through a lot of experimentation I have discovered that the rvmat is actually getting assigned but the texture files aren't loading. The only changes that I can see are changes in specular and specularPower. If I change these settings you can see the sheen obviously change. The _NOHQ, _SMDI, and _AS files do not seem to be loading though. Again, when the rvmat is assigned in the model those textures all work as intended. Share this post Link to post Share on other sites
Jackal326 1179 Posted July 31, 2021 On 7/29/2021 at 7:13 AM, TroyT said: Ok, through a lot of experimentation I have discovered that the rvmat is actually getting assigned but the texture files aren't loading. The only changes that I can see are changes in specular and specularPower. If I change these settings you can see the sheen obviously change. The _NOHQ, _SMDI, and _AS files do not seem to be loading though. Again, when the rvmat is assigned in the model those textures all work as intended. Then is sounds like your packing tool is excluding textures that aren't directly referenced by either the model or rvmats you're Binarizing... I've just had a look and can't seem to see an option in pboProject to force it to pack all paas so maybe its worth you creating a 'dummy' model that has several faces in it that reference all of your textures (including _nohq, _smdi etc) and then when its Binarized it'll force pboProject to pack the textures... Share this post Link to post Share on other sites
TroyT 6 Posted July 31, 2021 On 7/31/2021 at 5:55 AM, Jackal326 said: Then is sounds like your packing tool is excluding textures that aren't directly referenced by either the model or rvmats you're Binarizing... I've just had a look and can't seem to see an option in pboProject to force it to pack all paas so maybe its worth you creating a 'dummy' model that has several faces in it that reference all of your textures (including _nohq, _smdi etc) and then when its Binarized it'll force pboProject to pack the textures... I had already confirmed the paths by assigning the rvmat directly in the model. HorribleGoat replied in Discord and now I have the answer. You need to have at least one rvmat file assigned in your model in order for "hiddenSelectionsMaterials" to work. No need for edit LODs. Share this post Link to post Share on other sites
Jackal326 1179 Posted July 31, 2021 2 hours ago, TroyT said: I had already confirmed the paths by assigning the rvmat directly in the model. Yes, by assigning the rvmat to the model, Binarize will pack the nohq and smdi textures as they are DIRECTLY referenced (well, indirectly via the rvmat) within the model. Without the textures/RVMATS being assigned they are not packed by pboProject...The paths will exist with the textures/rvmats assigned to the model, but without that and simply using hiddenSelectionsMaterials the _smdi and _nohq are not referenced and are not packed. Thats basically what I was getting at. If you assign the textures (perhaps in an edit LOD) they'll be packed theoretically (I know EDIT lods are removed during binarization so might not work as intended). Ironically if you were to use Addon Builder from the ArmA 3 toolset, there is an option to force the packing of all .paa files regardless of whether they are referenced in a model/rvmat or not. Its a shame there isn't a similar option in pboProject. Share this post Link to post Share on other sites