Looking at your error, the issue is that **Time Remapping must be explicitly enabled** on a layer before you can set keyframes on it. In After Effects, time remapping is not enabled by default on layers, including precomps.
Here's why this happens and how to fix it:
## The Problem
When you add a precomp to a timeline, it doesn't have time remapping enabled by default. The time remap property exists but is "hidden" (not active), which is why you get the error:
```
"Can not 'set value at time' with this property, because the property or a parent property is hidden."
```
## The Solution
Before setting time remap keyframes, you need to enable time remapping first:
```javascript
// Get your layer (assuming comp and layerIndex are defined)
var layer = comp.layer(layerIndex);
// Enable time remapping - this is the crucial step!
layer.timeRemapEnabled = true;
// Now you can access and set keyframes on the time remap property
var timeRemap = layer.property("ADBE Time Remapping");
timeRemap.setValueAtTime(0, 0);
timeRemap.setValueAtTime(2.5, 5);
```
## Additional Considerations
1. **Check if already enabled**: You might want to check if time remapping is already enabled to avoid errors:
```javascript
if (!layer.timeRemapEnabled) {
layer.timeRemapEnabled = true;
}
```
2. **Property access**: Sometimes you might need to use the full property path:
```javascript
var timeRemap = layer.property("ADBE Layer Overrides").property("ADBE Time Remapping");
```
3. **Precomp duration**: Make sure the values you're setting make sense for the precomp's duration. Setting a time remap value of 5 seconds on a 3-second precomp might cause issues.
Your CEP extension should enable time remapping as part of the `animate_time_remap` command before attempting to set keyframes. This is a common oversight when working with time remapping via scripting!