feat: Add Flip X and Flip Y options for UV baking
Build and Deploy / build-and-push (push) Successful in 1m56s
Build and Deploy / build-and-push (push) Successful in 1m56s
This commit is contained in:
@@ -7,7 +7,7 @@ import { useTexturePipeline } from "../hooks/useTexturePipeline";
|
||||
interface ModelViewerProps {
|
||||
object: THREE.Object3D | null;
|
||||
sceneObjects: any[];
|
||||
bakeRequest?: { id: string, type: 'planar' | 'cylinder' | 'sphere' | 'box', timestamp: number } | null;
|
||||
bakeRequest?: { id: string, type: 'planar' | 'cylinder' | 'sphere' | 'box', flipX?: boolean, flipY?: boolean, timestamp: number } | null;
|
||||
onBakeComplete?: (dataUrl: string) => void;
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ export const ModelViewer = forwardRef<THREE.Group, ModelViewerProps>(({ object,
|
||||
|
||||
// Bake
|
||||
try {
|
||||
const dataUrl = bakeTextureToNewUVs(targetMesh, oldUVArray, tex, gl, 1024);
|
||||
const dataUrl = bakeTextureToNewUVs(targetMesh, oldUVArray, tex, gl, 1024, bakeRequest.flipX, bakeRequest.flipY);
|
||||
onBakeComplete(dataUrl);
|
||||
} catch (e) {
|
||||
console.error("Baking failed", e);
|
||||
|
||||
Reference in New Issue
Block a user