Auto-Follow reset after scene reload

Greetings.

I made a simple script, the purpose of which is to turn off Auto-Follow morphs that are automatically generated on clothes.

var search_names = ['morph label'];var main_figure = Scene.getPrimarySelection();const aGROUPS = main_figure.getPropertyGroups();const p_list = aGROUPS.getAllProperties();var tmp_p;for( var i = 0; i < p_list.length; i++ ){		tmp_p = p_list[i];		for (s=0; s < search_names.length; s++){		if (tmp_p.getLabel() == search_names[s]){						tmp_p.setCanAutoFollow(false);						tmp_p.setIsClamped(true);			tmp_p.setMin(0.00001);			tmp_p.setMax(0.00001);		};	};};

 

The script search for a parameters, turns off Auto-Follow and sets the value limits to 0.001% ("Use Limits").
"Use Limits" are the easiest way to prevent a parameter from being overwritten and reset when the scene is reloaded.

The script works fine, Auto-Follow morphs are turned off, but if you save and reload the scene, everything returns to its original state.

If after script execution go manually to "Parameter Settings" of edited morph and click "Accept" (not changing anything at all), only in this case all new settings will be saved forever and will not be reset even after a scene reload.

Why it happens? 
What can be done to save the settings forever, only by means of a script, without manual "Accept" clicking?

Post edited by yesyes3000_3dea668d3d on
Sign In or Register to comment.