Page MenuHomeFeedback Tracker

Access CfgModels via script
Assigned, UrgentPublic

Description

There isn't really a way for us to access a model's model.cfg or CfgModels config via script. There's typically some good information in the model.cfg that could be used in script to help with finding memory point and selection names. Using GetGame().ConfigIsExisting(path) with CfgModels being the lead, and an exact path to a model.cfg's animation class, returns false.

I have an example with buildings, I would like to be able to get all the doors in a building, and be able to associate a twin doors with door selections and also have the axis associated with each door; it's already possible to find the Doors class in CfgVehicles, but this returns the full selection of the doors twins and non twins, any doors associated with a twin door is skipped and not shown here.

I don't have much hope for this type of feature to even have an export in enforce, as it's relating to the RV portion. Attached in additional info is the export from Eliteness, a mikero tool which allows us to peer into a model's LOD information without debinning it.

Here's a small example of how I'm trying to access this this data, this was used in workbench with breakpoints so I can see the watched variables.

string path = "CfgModels " + bldg.GetModelName() + " Animations";
int count = GetGame().ConfigGetChildrenCount(path);

for (int i = 0; i < count; i++)
{
    string child;
    GetGame().ConfigGetChildName(path, i, child);

    string child_path = "CfgModels " + bldg.GetModelName() + " Animations " + child + " selection";
    string selection_name = GetGame().ConfigGetTextOut(child_path);

    child_path = "CfgModels " + bldg.GetModelName() + " Animations " + child + " axis";
    string axis_name = GetGame().ConfigGetTextOut(child_path);

    child_path = "CfgModels " + bldg.GetModelName() + " Animations " + child + " angle1";
    float radius = GetGame().ConfigGetTextOut(child_path).ToFloat();
}

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General
Additional Information
////////////////////////////////////////////////////////////////////
//Extracted House_2W02.cfg for House_2W02.p3d
//Produced from mikero's Dos Tools Dll version 7.94
//https://mikero.bytex.digital/Downloads
//'now' is Fri Jan 08 00:10:58 2021 : 'file' last modified on Fri Oct 16 02:05:40 2020
////////////////////////////////////////////////////////////////////

class cfgSkeletons
{
	class Skeleton5Doors
	{
		skeletonInherit = "";
		isDiscrete = 1;
		SkeletonBones[]=
		{
			"doors1"	,"",
			"doors2"	,"",
			"doors3"	,"",
			"doors4"	,"",
			"doors5"	,""
		};
	};
};
class CfgModels
{
	class Default
	{
		sections[] = {};
		sectionsInherit="";
		skeletonName = "";
	};
	class House_2W02:Default
	{
		skeletonName="Skeleton5Doors";
/*<potential axis>
1-housev_2t2_multi
\dz\structures\proxy_buildingparts\roof\antennabigroof\antenna_big_roof.001
actionbegin1
actionbegin3
actionbegin4
actionbegin5
actionend1
actionend3
actionend4
actionend5
doors1
doors1_axis
doors2
doors2_axis
doors3
doors3_action
doors3_axis
doors4
doors4_action
doors4_axis
doors5
doors5_action
doors5_axis
doorstwin1
doorstwin1_action
fireplace_action1
fireplace_point1
fireplace_rot1
fireplace_smoke1
in1
in2
in3
in4
occluder_01
proxyoccluder_01
sound_rainobjectinner0gutter_1
sound_rainobjectinner0gutter_2
sound_rainobjectinner0gutter_3
sound_rainobjectinner0gutter_4
sound_rainobjectinner3metal1_1
sound_rainobjectinner3metal1_2
sound_rainobjectinner3metal1_3
</potential axis>*/
		class Animations
		{
			class Doors1
			{
				type="rotation";
				source="doorstwin1";
				selection="doors1";
				axis="doors1_axis";//*probably*
//				sourceAddress = clamp;// (default)
				minValue = 0.0;//rad 0.0
				maxValue = 1.0;//rad 57.29578
				angle0 = 0.0;//rad 0.0;
				angle1 = 1.6929693;//rad 97.0;
//				memory = true;//(default assumed)
			};
			class Doors2
			{
				type="rotation";
				source="doorstwin1";
				selection="doors2";
				axis="doors2_axis";//*probably*
//				sourceAddress = clamp;// (default)
				minValue = 0.0;//rad 0.0
				maxValue = 1.0;//rad 57.29578
				angle0 = 0.0;//rad 0.0;
				angle1 = -1.6755161;//rad -96.0;
//				memory = true;//(default assumed)
			};
			class Doors3
			{
				type="rotation";
				source="doors3";
				selection="doors3";
				axis="doors3_axis";//*probably*
//				sourceAddress = clamp;// (default)
				minValue = 0.0;//rad 0.0
				maxValue = 1.0;//rad 57.29578
				angle0 = 0.0;//rad 0.0;
				angle1 = -1.5707964;//rad -90.0;
//				memory = true;//(default assumed)
			};
			class Doors4
			{
				type="rotation";
				source="doors4";
				selection="doors4";
				axis="doors4_axis";//*probably*
//				sourceAddress = clamp;// (default)
				minValue = 0.0;//rad 0.0
				maxValue = 1.0;//rad 57.29578
				angle0 = 0.0;//rad 0.0;
				angle1 = 1.5707964;//rad 90.0;
//				memory = true;//(default assumed)
			};
			class Doors5
			{
				type="rotation";
				source="doors5";
				selection="doors5";
				axis="doors5_axis";//*probably*
//				sourceAddress = clamp;// (default)
				minValue = 0.0;//rad 0.0
				maxValue = 1.0;//rad 57.29578
				angle0 = 0.0;//rad 0.0;
				angle1 = 1.5707964;//rad 90.0;
//				memory = true;//(default assumed)
			};
		};//</Animations>
	}//</Modelclass>
};//</CfgModels>

Event Timeline

Jest added a subscriber: Jest.Jan 8 2021, 7:30 AM
Geez changed the task status from New to Assigned.Jan 8 2021, 10:12 AM
Ralian added a subscriber: Ralian.Mar 11 2021, 8:51 AM