Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Get access to Fill property (JScript)

Explorer ,
Feb 23, 2020 Feb 23, 2020

Hello. Guys, i don't understand how can i get access to Fill property in JS.

Pls, Help. I want to disable it with the code.

Untitled.jpg

TOPICS
Expressions , Scripting , SDK , User interface or workspaces
775
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 23, 2020 Feb 23, 2020

This property and value is written in one of the Preference files - find all the prefs files and look for that property.

Unless you need to change the Fill color of the Shape layer, which is a totally different thing.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 23, 2020 Feb 23, 2020

//Unless you need to change the Fill color of the Shape layer, which is a totally different thing//

Yes, but my shape layer is a text and he has many sub shapes, and i can't find a solution to select them all. Becouse each subshape has his own position of Fill property.Untitled1.jpg  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 23, 2020 Feb 23, 2020

Well, it's not a Text layer, but a Shape Layer.

To change the Fill effect of each group inside the Shape layer, you need to iterate through all the groups and set Fill value separately.

Here's a basic example that will change all Fill colors

(function() {
	var composition = app.project.activeItem;
	if (!composition || !(composition instanceof CompItem)) {
		return alert('Please select composition first');
	}

	var layer = composition.selectedLayers[0];
	if (!layer) {
		return alert('Please select a layer');
	}

	app.beginUndoGroup('Set fill Color');

	setFillColor(layer, [0.123, 0.456, 0.789]);

	app.endUndoGroup();

	function setFillColor(baseProperty, color) {
		var property;
		for (var i = 1, il = baseProperty.numProperties; i <= il; i++) {
			property = baseProperty(i);
			if (property.propertyType === PropertyType.PROPERTY && property.matchName === 'ADBE Vector Fill Color') {
				property.setValue(color);
			} else {
				setFillColor(property, color);
			}
		}
	}
})();
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 23, 2020 Feb 23, 2020
LATEST

Thanks, i try this!!

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines