mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-18 07:35:19 +00:00
Feature/expressions fix to (#579)
QOL Panel Changes The style name is shown when rendering a movie, missing title due to issues with the API. The progress bar moves to 0 to 40 then 100, but this is still fake. Added Animation Type to the Characters so they would not show expressions unless they had it. ROKO and Storygirl need their metadata updated for this. TEAM TESTING ONLY Will have this metadata. Changed Expression to Facial Expression. Changed Lip Sync to Vocals / Speech Changed Copy to reflect Timeline Track Changes. I removed the Mannequins since they do not work well with the scenes.
This commit is contained in:
1 parent
18d69e4121
commit
da12790908
17 files changed
+115
-58
No files matched your search
@@ -9,7 +9,7 @@ import { useSignals } from "@preact/signals-react/runtime";
|
||||
import { downloadFile } from "~/pages/PageEnigma/comps/GenerateModals/utils/downloadFile";
|
||||
import { styleList } from "~/pages/PageEnigma/styleList";
|
||||
|
||||
function getStyleName(typeInput: string) {
|
||||
export function getStyleName(typeInput: string) {
|
||||
const foundStyle = styleList.find((style) => {
|
||||
return style.type === typeInput;
|
||||
});
|
||||
|
||||
@@ -15,26 +15,34 @@ import { ActiveJob } from "~/pages/PageEnigma/models";
|
||||
import { Tooltip } from "~/components";
|
||||
import { JobsApi } from "~/Classes/ApiManager";
|
||||
import { PollRecentJobs } from "~/hooks/useActiveJobs/utilities";
|
||||
|
||||
import { getStyleName } from "~/pages/PageEnigma/comps/GenerateModals/CompletedCard";
|
||||
interface Props {
|
||||
movie: ActiveJob;
|
||||
}
|
||||
|
||||
function getPercent(status: JobState) {
|
||||
if (status === JobState.STARTED) {
|
||||
return 20;
|
||||
}
|
||||
if (
|
||||
[
|
||||
JobState.PENDING,
|
||||
JobState.COMPLETE_FAILURE,
|
||||
JobState.ATTEMPT_FAILED,
|
||||
JobState.DEAD,
|
||||
].includes(status)
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 100;
|
||||
if (status === JobState.PENDING) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
if (status === JobState.STARTED) {
|
||||
return 40;
|
||||
}
|
||||
|
||||
if (status === JobState.COMPLETE_SUCCESS) {
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
|
||||
export function InProgressCard({ movie }: Props) {
|
||||
@@ -56,6 +64,7 @@ export function InProgressCard({ movie }: Props) {
|
||||
response.errorMessage || "Error deleting the file.",
|
||||
);
|
||||
}, []);
|
||||
console.log(movie);
|
||||
|
||||
return (
|
||||
<div className="flex w-full items-center justify-between px-5 py-3 text-start transition-all duration-150">
|
||||
@@ -74,6 +83,9 @@ export function InProgressCard({ movie }: Props) {
|
||||
<div className="font-medium">
|
||||
{movie.request.maybe_model_title || "Untitled"}
|
||||
</div>
|
||||
<div className="font-medium">
|
||||
{getStyleName(movie.request.maybe_style_name) || "Untitled"}
|
||||
</div>
|
||||
<div className="relative block h-[6px] w-[560px] overflow-hidden rounded-lg bg-white/10">
|
||||
<div
|
||||
className="absolute inset-0 block h-[6px] rounded-lg bg-brand-primary"
|
||||
|
||||
@@ -72,6 +72,7 @@ export const CharactersTab = () => {
|
||||
name: item.maybe_title ?? "Unknown",
|
||||
type: AssetType.CHARACTER,
|
||||
media_type: item.media_type,
|
||||
maybe_animation_type: item.maybe_animation_type,
|
||||
version: 1,
|
||||
...(item.cover_image.maybe_cover_image_public_bucket_path
|
||||
? {
|
||||
@@ -129,6 +130,7 @@ export const CharactersTab = () => {
|
||||
featuredObjectsFetch: FetchStatus.SUCCESS,
|
||||
}));
|
||||
const newCharacters = responseMapping(response.data);
|
||||
|
||||
setFeaturedCharacters(newCharacters);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -112,8 +112,7 @@ export const ExpressionTab = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<TabTitle title="Expressions" />
|
||||
|
||||
<TabTitle title="Face Expression" />
|
||||
<FilterButtons
|
||||
value={selectedFilter}
|
||||
onClick={(button) => {
|
||||
@@ -121,7 +120,6 @@ export const ExpressionTab = () => {
|
||||
setCurrentPage(0);
|
||||
}}
|
||||
/>
|
||||
|
||||
<div className="flex w-full flex-col gap-2.5 px-4">
|
||||
<Button
|
||||
icon={faCirclePlus}
|
||||
@@ -129,8 +127,29 @@ export const ExpressionTab = () => {
|
||||
onClick={() => setOpen(true)}
|
||||
className="w-full py-3 text-sm font-medium"
|
||||
>
|
||||
Upload Expression
|
||||
Upload Expression ( Developer Only )
|
||||
</Button>
|
||||
{/* <ButtonDialogue
|
||||
buttonProps={{
|
||||
variant: "secondary",
|
||||
label:
|
||||
"Watch a tutorial on how to create expressions using your iPhone",
|
||||
className:
|
||||
"justify-center border-2 border-white/30 hover:border-white/40 text-start p-3 gap-3.5 rounded-xl",
|
||||
icon: faMobileNotch,
|
||||
iconClassName: "text-3xl",
|
||||
}}
|
||||
dialogProps={{
|
||||
className: "max-w-6xl",
|
||||
}}
|
||||
title={<>Video Tutorial: Creating your own expressions</>}
|
||||
>
|
||||
<video
|
||||
className="aspect-video w-full rounded-lg"
|
||||
controls
|
||||
src="https://storage.googleapis.com/vocodes-public/media/t/p/w/q/6/tpwq6beqn95f1h1q9e88c42r0gdekg7p/storyteller_tpwq6beqn95f1h1q9e88c42r0gdekg7p.mp4"
|
||||
></video>
|
||||
</ButtonDialogue> */}
|
||||
</div>
|
||||
<div className="h-full w-full overflow-y-auto px-4 pb-4">
|
||||
<ItemElements
|
||||
|
||||
@@ -29,7 +29,7 @@ export const tabList = [
|
||||
},
|
||||
{
|
||||
icon: "/resources/icons/expressions.png",
|
||||
title: "Expressions",
|
||||
title: "Facial Expression",
|
||||
value: AssetType.EXPRESSION,
|
||||
component: <ExpressionTab />,
|
||||
},
|
||||
|
||||
@@ -83,6 +83,11 @@ export const Character = ({ character }: Props) => {
|
||||
minimized,
|
||||
} = character;
|
||||
|
||||
let hasExpression = false;
|
||||
if (character.maybe_animation_type != null) {
|
||||
hasExpression = true;
|
||||
}
|
||||
|
||||
if (minimized) {
|
||||
return (
|
||||
<div
|
||||
@@ -142,13 +147,15 @@ export const Character = ({ character }: Props) => {
|
||||
updateKeyframe={updateClipPosition}
|
||||
group={ClipGroup.CHARACTER}
|
||||
/>
|
||||
<TrackClips
|
||||
id={character.object_uuid}
|
||||
clips={expressionClips}
|
||||
updateClip={updateClipEmotions}
|
||||
group={ClipGroup.CHARACTER}
|
||||
type={ClipType.EXPRESSION}
|
||||
/>
|
||||
{hasExpression && (
|
||||
<TrackClips
|
||||
id={character.object_uuid}
|
||||
clips={expressionClips}
|
||||
updateClip={updateClipEmotions}
|
||||
group={ClipGroup.CHARACTER}
|
||||
type={ClipType.EXPRESSION}
|
||||
/>
|
||||
)}
|
||||
{editorEngine &&
|
||||
editorEngine.isObjectLipsync(character.object_uuid) && (
|
||||
<TrackClips
|
||||
|
||||
@@ -6,13 +6,14 @@ export function GlobalAudioHeader() {
|
||||
width="15"
|
||||
height="12"
|
||||
viewBox="0 0 15 12"
|
||||
fill="none">
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
d="M8.25 11.25C8.25 11.6648 7.91484 12 7.5 12C7.08516 12 6.75 11.6648 6.75 11.25V0.75C6.75 0.335156 7.08516 0 7.5 0C7.91484 0 8.25 0.335156 8.25 0.75V11.25ZM12.75 9.75C12.75 10.1648 12.4148 10.5 12 10.5C11.5852 10.5 11.25 10.1648 11.25 9.75V2.25C11.25 1.83516 11.5852 1.5 12 1.5C12.4148 1.5 12.75 1.83516 12.75 2.25V9.75ZM6 9C6 9.41484 5.66484 9.75 5.25 9.75C4.83516 9.75 4.5 9.41484 4.5 9V3C4.5 2.58516 4.83516 2.25 5.25 2.25C5.66484 2.25 6 2.58516 6 3V9ZM10.5 8.25C10.5 8.66484 10.1648 9 9.75 9C9.33516 9 9 8.66484 9 8.25V3.75C9 3.33516 9.33516 3 9.75 3C10.1648 3 10.5 3.33516 10.5 3.75V8.25ZM3.75 6.75C3.75 7.16484 3.41484 7.5 3 7.5C2.58516 7.5 2.25 7.16484 2.25 6.75V5.25C2.25 4.83516 2.58516 4.5 3 4.5C3.41484 4.5 3.75 4.83516 3.75 5.25V6.75ZM0 6C0 5.80109 0.0790176 5.61032 0.21967 5.46967C0.360322 5.32902 0.551088 5.25 0.75 5.25C0.948912 5.25 1.13968 5.32902 1.28033 5.46967C1.42098 5.61032 1.5 5.80109 1.5 6C1.5 6.19891 1.42098 6.38968 1.28033 6.53033C1.13968 6.67098 0.948912 6.75 0.75 6.75C0.551088 6.75 0.360322 6.67098 0.21967 6.53033C0.0790176 6.38968 0 6.19891 0 6ZM13.5 6C13.5 5.80109 13.579 5.61032 13.7197 5.46967C13.8603 5.32902 14.0511 5.25 14.25 5.25C14.4489 5.25 14.6397 5.32902 14.7803 5.46967C14.921 5.61032 15 5.80109 15 6C15 6.19891 14.921 6.38968 14.7803 6.53033C14.6397 6.67098 14.4489 6.75 14.25 6.75C14.0511 6.75 13.8603 6.67098 13.7197 6.53033C13.579 6.38968 13.5 6.19891 13.5 6Z"
|
||||
fill="white"
|
||||
/>
|
||||
</svg>
|
||||
Global Audio
|
||||
Music
|
||||
</>
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -15,7 +15,7 @@ export const LipSyncSubHeader = ({
|
||||
return (
|
||||
<div className="mb-1 flex h-[30px] flex-col justify-center pl-[22px] text-xs font-medium text-white opacity-80">
|
||||
<div className="flex gap-3">
|
||||
Lip Sync
|
||||
Vocal / Speech
|
||||
<button
|
||||
className="text-md text-white transition-colors duration-100 hover:text-white/80"
|
||||
onClick={() => toggleLipSyncMute(character.object_uuid)}
|
||||
|
||||
@@ -50,6 +50,7 @@ export const RowHeaders = () => {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
key={character.object_uuid}
|
||||
@@ -71,9 +72,11 @@ export const RowHeaders = () => {
|
||||
<div className="mb-1 flex h-[30px] flex-col justify-center pl-[22px] text-xs font-medium text-white opacity-80">
|
||||
Position
|
||||
</div>
|
||||
<div className="mb-1 flex h-[30px] flex-col justify-center pl-[22px] text-xs font-medium text-white opacity-80">
|
||||
Expression
|
||||
</div>
|
||||
{character.maybe_animation_type != null && (
|
||||
<div className="mb-1 flex h-[30px] flex-col justify-center pl-[22px] text-xs font-medium text-white opacity-80">
|
||||
Facial Expression
|
||||
</div>
|
||||
)}
|
||||
<LipSyncSubHeader character={character} />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -21,14 +21,6 @@ interface Props {
|
||||
updateClip: (options: { id: string; length: number; offset: number }) => void;
|
||||
}
|
||||
|
||||
const CLIP_TITLES: Record<ClipType, string> = {
|
||||
[ClipType.ANIMATION]: "animation",
|
||||
[ClipType.AUDIO]: "lip sync",
|
||||
[ClipType.EXPRESSION]: "expression",
|
||||
[ClipType.TRANSFORM]: "",
|
||||
[ClipType.FAKE]: "",
|
||||
};
|
||||
|
||||
function getCanDrop({
|
||||
dragType,
|
||||
type,
|
||||
@@ -43,16 +35,19 @@ function getCanDrop({
|
||||
return true;
|
||||
}
|
||||
if (type === ClipType.AUDIO) {
|
||||
DndAsset.notDropText = "Cannot drag animation onto audio track";
|
||||
DndAsset.notDropText =
|
||||
"Cannot drag character animation onto vocals and speech track";
|
||||
}
|
||||
if (type === ClipType.EXPRESSION) {
|
||||
DndAsset.notDropText = "Cannot drag animation onto expression track";
|
||||
DndAsset.notDropText =
|
||||
"Cannot drag character animation onto facial expression track";
|
||||
}
|
||||
if (group === ClipGroup.GLOBAL_AUDIO) {
|
||||
DndAsset.notDropText = "Cannot drag animation onto global audio track";
|
||||
DndAsset.notDropText = "Cannot drag character animation onto music track";
|
||||
}
|
||||
if (group === ClipGroup.CAMERA) {
|
||||
DndAsset.notDropText = "Cannot drag animation onto camera track";
|
||||
DndAsset.notDropText =
|
||||
"Cannot drag character animation onto camera track";
|
||||
}
|
||||
}
|
||||
if (dragType === AssetType.EXPRESSION) {
|
||||
@@ -76,10 +71,10 @@ function getCanDrop({
|
||||
DndAsset.notDropText = "Cannot drag audio onto camera track";
|
||||
}
|
||||
if (type === ClipType.ANIMATION) {
|
||||
DndAsset.notDropText = "Cannot drag audio onto animation track";
|
||||
DndAsset.notDropText = "Cannot drag audio onto character animation track";
|
||||
}
|
||||
if (type === ClipType.EXPRESSION) {
|
||||
DndAsset.notDropText = "Cannot drag audio onto expression track";
|
||||
DndAsset.notDropText = "Cannot drag audio onto facial expression track";
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -189,7 +184,17 @@ export const TrackClips = ({ id, clips, updateClip, group, type }: Props) => {
|
||||
<FontAwesomeIcon icon={faArrowUp} className="text-white/80" />
|
||||
</div>
|
||||
<div className="text-xs text-white/80">
|
||||
Drag and drop {CLIP_TITLES[type!] ?? "audio"} clip here
|
||||
{type === ClipType.TRANSFORM
|
||||
? "Drag and Drop TRANSFORM clip here" // This should not show
|
||||
: type === ClipType.AUDIO
|
||||
? "Drag and drop character speech or vocal audio clips here"
|
||||
: type === ClipType.ANIMATION
|
||||
? "Drag and drop character animation clips here"
|
||||
: type === ClipType.EXPRESSION
|
||||
? "Drag and drop facial expression animation clips here"
|
||||
: type === ClipType.FAKE
|
||||
? "Drag and Drop FAKE clip here" // this should not show.
|
||||
: "Drag and drop uploaded music clips or sound effects from the audio tab here"}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -7,6 +7,7 @@ export class ClipUI {
|
||||
type: ClipType;
|
||||
group: ClipGroup;
|
||||
name: string;
|
||||
maybe_animation_type: string;
|
||||
media_id: string;
|
||||
object_uuid: string;
|
||||
object_name: string;
|
||||
@@ -21,6 +22,7 @@ export class ClipUI {
|
||||
type: ClipType,
|
||||
group: ClipGroup,
|
||||
name: string,
|
||||
maybe_animation_type: string,
|
||||
media_id: string,
|
||||
clip_uuid: string,
|
||||
object_uuid: string,
|
||||
@@ -31,7 +33,7 @@ export class ClipUI {
|
||||
) {
|
||||
this.version = version;
|
||||
this.group = group; // Only needed for UI
|
||||
|
||||
this.maybe_animation_type = maybe_animation_type; // only characters. : not used by engine.
|
||||
this.clip_uuid = clip_uuid;
|
||||
|
||||
this.name = name; // UI
|
||||
@@ -55,6 +57,7 @@ export class ClipUI {
|
||||
clip_uuid: this.clip_uuid,
|
||||
object_uuid: this.object_uuid,
|
||||
object_name: this.object_name,
|
||||
maybe_animation_type: this.maybe_animation_type,
|
||||
media_id: this.media_id,
|
||||
start_offset: this.offset,
|
||||
ending_offset: this.length,
|
||||
|
||||
@@ -3,6 +3,7 @@ import { AssetType } from "~/enums";
|
||||
export interface MediaItem {
|
||||
version: number;
|
||||
type: AssetType;
|
||||
maybe_animation_type: string | null;
|
||||
media_type?: string;
|
||||
media_id: string;
|
||||
object_uuid?: string;
|
||||
|
||||
@@ -12,6 +12,7 @@ export interface MediaInfo {
|
||||
token: string;
|
||||
media_type: MediaFileType;
|
||||
media_class: MediaFileClass | null;
|
||||
maybe_animation_type: string | null;
|
||||
maybe_media_subtype: MediaFileSubtype | null;
|
||||
maybe_engine_extension: string | null;
|
||||
maybe_batch_token: string;
|
||||
|
||||
@@ -34,6 +34,7 @@ export interface CharacterGroup {
|
||||
export interface CharacterTrack {
|
||||
object_uuid: string;
|
||||
media_id: string;
|
||||
maybe_animation_type: string | null;
|
||||
name: string;
|
||||
muted: boolean;
|
||||
minimized: boolean;
|
||||
|
||||
@@ -22,6 +22,7 @@ export function addNewCharacter(data: MediaItem) {
|
||||
object_uuid: data.object_uuid,
|
||||
name: data.name,
|
||||
media_id: data.media_id,
|
||||
maybe_animation_type: data.maybe_animation_type,
|
||||
muted: false,
|
||||
minimized: false,
|
||||
animationClips: [],
|
||||
|
||||
@@ -16,6 +16,7 @@ function getAddCharacter(item: ClipUI) {
|
||||
object_uuid: item.object_uuid,
|
||||
name: item.object_name,
|
||||
media_id: item.media_id,
|
||||
maybe_animation_type: item.maybe_animation_type,
|
||||
muted: false,
|
||||
minimized: false,
|
||||
animationClips: [],
|
||||
|
||||
@@ -529,23 +529,7 @@ export const cameraItems = signal<MediaItem[]>([
|
||||
export const characterItems = signal<MediaItem[]>([
|
||||
{
|
||||
version: 1,
|
||||
media_id: "m_r7w1tmkx2jg8nznr3hyzj4k6zhfh7d ",
|
||||
type: AssetType.CHARACTER,
|
||||
name: "Female Doll",
|
||||
thumbnail: "/resources/characters/img03.png",
|
||||
media_type: "glb",
|
||||
},
|
||||
{
|
||||
version: 1,
|
||||
media_id: "m_9sqg0evpr23587jnr8z3zsvav1x077 ",
|
||||
type: AssetType.CHARACTER,
|
||||
name: "Male Doll",
|
||||
thumbnail: "/resources/characters/img07.png",
|
||||
media_type: "glb",
|
||||
},
|
||||
{
|
||||
version: 1,
|
||||
media_id: "m_pwtk45wsfr5z2bavmwxh2efnwvh4rr ",
|
||||
media_id: "m_gff67btr810vg3ng9szj85zskztcgy",
|
||||
type: AssetType.CHARACTER,
|
||||
name: "Story Girl",
|
||||
thumbnail: "/resources/characters/img13.png",
|
||||
@@ -563,6 +547,22 @@ export const characterItems = signal<MediaItem[]>([
|
||||
|
||||
// TODO: CHANGE TO THIS FOR DEV MODE:
|
||||
export const devCharacterItems = signal<MediaItem[]>([
|
||||
{
|
||||
version: 1,
|
||||
media_id: "m_r7w1tmkx2jg8nznr3hyzj4k6zhfh7d ",
|
||||
type: AssetType.CHARACTER,
|
||||
name: "Female Doll",
|
||||
thumbnail: "/resources/characters/img03.png",
|
||||
media_type: "glb",
|
||||
},
|
||||
{
|
||||
version: 1,
|
||||
media_id: "m_9sqg0evpr23587jnr8z3zsvav1x077 ",
|
||||
type: AssetType.CHARACTER,
|
||||
name: "Male Doll",
|
||||
thumbnail: "/resources/characters/img07.png",
|
||||
media_type: "glb",
|
||||
},
|
||||
{
|
||||
version: 1,
|
||||
media_id: "m_fmxy8wjnep1hdaz7qdg4n7y15d2bsp",
|
||||
|
||||
Reference in new issue
Block a user