Setting clip opacity to zero makes it opaque and not fully transparent/invisible

I’m not sure if this is a widespread problem or if I’m doing something that’s specifically causing this bug to happen, but when I set a clip’s transparency to 0 it shows up opaque (same as if I set it to 1). However, any values between 0 and 1 have the expected opacity (or at least it looks like it—I’m not going to pretend I can tell the difference between 0.3 and 0.4 :stuck_out_tongue:). To remedy this for now, I’ve just been replacing any 0 values with 0.01 instead and that’s close enough for my purposes. That being said, I thought you should be aware of this since it is not the intended outcome (according to the API docs).

I’ve included JSON below for a video (weird AI content warning again) that demonstrates the problem for the first 31.25 seconds (because render fails if I use the full number of clips with no error so I’m trying to figure out what’s causing that to happen since it’s not file size and appears to be the number of clips).

The JSON is several times longer than the character limit for a forum post, so here’s a link: opacity-zero-is-opaque-ex.json

The JSON looks correct to me, plus it works just fine/as expected as long as I don’t use a zero for the opacity, so I think there’s a bug on your end. This isn’t the first weird behavior I’ve seen with float values but I was careful with the frame rate to ensure any fractional values weren’t excessively long. The only explanation that I can think of that makes sense is that the API is misinterpreting the opacity value as a boolean when it’s set to zero, doesn’t accept it, and defaults to opaque.

Of course, this is kind of a stupid issue to have because why would anyone ever need to set a clip’s opacity to zero since there’s not point in adding it if it can’t be seen. :stuck_out_tongue: I mean, maybe there is a reason that I can’t think of but I just did it because I was trying to test if I could essentially create an animation via PNG sequence and wanted to verify that/discover any limitations before removing redundancies and not adding clips that can’t be seen. (But on that note, this is a reason to consider increasing the POST request limit above 391kb—which is a very specific number, so I’m curious why you picked it. :slight_smile:)

Anyway, this may not even really need a fix if there’s never a reason someone would need to have an invisible clip—at least until keyframing for state tweens is a feature—but if this is the common behavior the API docs should reflect that you can’t actually have a zero opacity and should not add the clip if you don’t want it to show up. :stuck_out_tongue: I haven’t tested clip opacity outside of this scenario, however, so there could be some other reason this is happening. In any case, I figure it’s better if you’re aware of it.

Thanks for reporting this. Just reproduced it. Yes it appears it is considering 0 to be a false value and not apply any opacity.

I’ve added this to the backlog to be resolved (or at least made clear in the docs).

1 Like

Got a feeling the code in the backend looks something like:

opacity = (json.opacity) ? json.opacity : 1;

So if json.opacity === 0 it will evaluate as false and therefor you get 1.

I seem to remember a similar issue with volume or another value between 0 and 1.

Should be an easy enough fix. Thanks for reporting.

Thanks for your patience. This issue has now been resolved. Setting opacity to 0 makes the asset 100% transparent (invisible).

Good question. We currently use DynamoDB to store the JSON which has a max item size of 400kb. We allow JSON up to 390kb so there is 10kb spare to store other data against the item, such as id and a whole bunch of metadata.

Not the best architectural decision in hindsight but we will be able to fix that at some point by not storing the JSON in a DB at all. Our new template system stores the JSON in S3 so we will do something similar.