Skip to content

Commit a2d90b0

Browse files
authored
fix: typescript-build-issues related to DepthPicking and Linocut (#175)
* fix: normalize linocut center prop handling * feat: improve DepthPickingPass with shallowRef and props documentation * chore: remove DepthPickingPassPmndrs from exports and make pass plain object * chore: remove unused shallowRef import in DepthPickingPassPmndrs
1 parent 64ef99e commit a2d90b0

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

src/core/pmndrs/DepthPickingPassPmndrs.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
<script lang="ts" setup>
22
import type { DepthPackingStrategies } from 'three'
3+
import type { DepthCopyMode } from 'postprocessing'
34
import { DepthPickingPass } from 'postprocessing'
45
import { inject, nextTick, onUnmounted, watchEffect } from 'vue'
56
import { effectComposerInjectionKey } from './EffectComposerPmndrs.vue'
67
78
export interface DepthPickingPassPmndrsProps {
9+
/**
10+
* The depth packing strategy.
11+
* Default: RGBADepthPacking
12+
*/
813
depthPacking?: DepthPackingStrategies
9-
mode?: number
14+
15+
/**
16+
* The depth copy mode.
17+
* Default: DepthCopyMode.SINGLE
18+
*/
19+
mode?: DepthCopyMode
1020
}
1121
1222
const props = defineProps<DepthPickingPassPmndrsProps>()
@@ -21,10 +31,10 @@ const unwatch = watchEffect(() => {
2131
})
2232
2333
onUnmounted(() => {
24-
if (!composer?.value || !pass.value) { return }
34+
if (!composer?.value || !pass) { return }
2535
26-
composer?.value?.removePass(pass.value)
27-
pass.value.dispose()
36+
composer?.value?.removePass(pass)
37+
pass.dispose()
2838
})
2939
3040
defineExpose({ pass })

src/core/pmndrs/LinocutPmndrs.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const props = defineProps<LinocutPmndrsProps>()
1818
const { pass, effect } = useEffectPmndrs(
1919
() => new LinocutEffect({
2020
...props,
21-
center: Array.isArray(props.center) ? new Vector2().fromArray(props.center) : props.center,
21+
center: props.center instanceof Vector2 ? [props.center.x, props.center.y] : props.center,
2222
}),
2323
props,
2424
)

src/core/pmndrs/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import KuwaharaPmndrs, { type KuwaharaPmndrsProps } from './KuwaharaPmndrs.vue'
1818
import ColorAveragePmndrs, { type ColorAveragePmndrsProps } from './ColorAveragePmndrs.vue'
1919
import LensDistortionPmndrs, { type LensDistortionPmndrsProps } from './LensDistortionPmndrs.vue'
2020
import ShockWavePmndrs, { type ShockWavePmndrsProps } from './ShockWavePmndrs.vue'
21-
import DepthPickingPassPmndrs, { type DepthPickingPassPmndrsProps } from './DepthPickingPassPmndrs.vue'
2221
import TiltShiftPmndrs, { type TiltShiftPmndrsProps } from './TiltShiftPmndrs.vue'
2322
import DotScreenPmndrs, { type DotScreenPmndrsProps } from './DotScreenPmndrs.vue'
2423
import SepiaPmndrs, { type SepiaPmndrsProps } from './SepiaPmndrs.vue'
@@ -43,7 +42,6 @@ export {
4342
ColorAveragePmndrs,
4443
LensDistortionPmndrs,
4544
ShockWavePmndrs,
46-
DepthPickingPassPmndrs,
4745
TiltShiftPmndrs,
4846
DotScreenPmndrs,
4947
SepiaPmndrs,
@@ -65,7 +63,6 @@ export {
6563
ColorAveragePmndrsProps,
6664
LensDistortionPmndrsProps,
6765
ShockWavePmndrsProps,
68-
DepthPickingPassPmndrsProps,
6966
TiltShiftPmndrsProps,
7067
DotScreenPmndrsProps,
7168
SepiaPmndrsProps,

0 commit comments

Comments
 (0)