Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Detect when " Convolution effects cannot be merged " happens#492

Answeredbyvanruesc
vis-prime asked this question inQ&A
Discussion options

Whats an easy way to detect a convolution effect exists in composer.passes so that I can make programmatically make a new effectPass when adding another convolution effect ?

eg: Chromatic Abberration and SMAA

You must be logged in to vote

Sorry for the late response! I don't think there's a way to detect this currently. You could try copy&pasting the EffectAttribute check into your app as a workaround:

letattributes:EffectAttribute=EffectAttribute.NONE;for(consteffectofeffects){if(attributes&effect.getAttributes()&EffectAttribute.CONVOLUTION)!==0){// Convolution effect conflict.}attributes|=effect.getAttributes();}

I'll add a way to access this information in v7.

Replies: 2 comments

Comment options

Sorry for the late response! I don't think there's a way to detect this currently. You could try copy&pasting the EffectAttribute check into your app as a workaround:

letattributes:EffectAttribute=EffectAttribute.NONE;for(consteffectofeffects){if(attributes&effect.getAttributes()&EffectAttribute.CONVOLUTION)!==0){// Convolution effect conflict.}attributes|=effect.getAttributes();}

I'll add a way to access this information in v7.

You must be logged in to vote
0 replies
Answer selected byvis-prime
Comment options

I'll add a way to access this information in v7.

FYI: In v7 it's possible to detect whether effects can be merged by simply attempting to seteffectPass.effects inside a try-catch block. The setter will throw if the combination is invalid.

/**
* The effects.
*
*@throws If there are duplicate effects or if the effects cannot be merged.
*/
geteffects():readonlyEffect[]{
returnthis.subpassesasreadonlyEffect[];
}
protectedseteffects(value:Effect[]){
constdistinctEffects=newSet(value);
if(distinctEffects.size<value.length){
constduplicates=value.filter(x=>!distinctEffects.has(x)).map(x=>x.name);
thrownewError(`Encountered duplicate effects:${duplicates.join(", ")}`);
}
this.subpasses=value;
}

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@vis-prime@vanruesc

[8]ページ先頭

©2009-2025 Movatter.jp