inlife/nexrender

How to change text layer color and shape layer background color with json?

vimaloneuser opened this issue · 3 comments

image
image

I want to change the font color of THE WEDDING and I want to change the background color of Shape Layer 4 so I have tried with the below type of JSON but none of these are working.

"assets": [
{
"type": "data",
"layerName": "THE WEDDING",
"property": "Color",
"value": [1.0, 0.5, 0, 0]
}
{
"type": "data",
"layerName": "Shape Layer 4",
"property": "Color",
"value": [1.0, 0.5, 0, 0]
}
]
Error: Error: nexrender: Can't find a property sequence Color for key: Colorwithin layer: Shape Layer 4

"assets": [
{
"type": "data",
"layerName": "THE WEDDING",
"property": "Effects.Skin_Color.Color",
"value": [1, 0, 0]
}
{
"type": "data",
"layerName": "Shape Layer 4",
"property": "Effects.Skin_Color.Color",
"value": [1, 0, 0]
}
]
Error: Error: Error: nexrender: Can't find a property sequence Color for key: Effects.Skin_Color.Color layer: Shape Layer 4

Can anyone help here?

For the shape Layer, you need to provide the path of the property, it should be something like :
Contents.Rectangle 1.Fill.Color assuming your shape is a Rectangle.

For the text, the color is not accessible with a simple property.
I see two options, First you replace the value in your JSON with an expression to set the text style:
{ "type": "data", "layerName": "THE WEDDING", "property": "Text.Source Text", "expression": "let style = text.sourceText.style..setFillColor([1,0,0]);" },

Option 2 : you add a Color Control and use an expression on the Text to set the color using the Color Control, and in your JSON, you set Color Control itself.

expression on text : let style = text.sourceText.style; let color = effect("Color Control")("Color"); style.setFillColor(color);
JSON
{ "type": "data", "layerName": "THE WEDDING", "property": "Color Control..Color", "value": [1, 0, 0] }

Screenshot 2023-11-06 at 6 16 00 AM

Can you help me in how to target the source text? I am doing like this:
"assets": [ { "type": "data", "layerName": "01_01 Text", "property": "Source Text", "value": "hello" } ]

image
stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.