Dismissive commited on
Commit
159d79b
·
verified ·
1 Parent(s): f6aa61b

create an application that is a a 2D VFX to 3D FBX converter. It takes a 2D visual effect animation (like a GIF) as input, analyzes its characteristics, generates corresponding 3D meshes and textures, integrates them into a Blender model, and finally exports the result as a Roblox-compatible FBX file. The core functionality involves: Frame Extraction: Breaking down the input 2D animation into individual frames. VFX Analysis: Analyzing the extracted frames to understand the visual effect's properties (e.g., type, motion). Mesh Generation: Creating 3D mesh data based on the analysis, including a base mesh and animated meshes for dynamic elements. Texture Mapping: Generating textures and materials from the 2D frames and applying them to the 3D meshes. Blender Integration: Using Blender to assemble the 3D meshes and textures into a complete model. FBX Export: Exporting the final 3D model as an FBX file, with a focus on compatibility with Roblox. ensure that the application is able to read and write, and make it into a .exe - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +331 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Rbx3d
3
- emoji: 🦀
4
- colorFrom: gray
5
  colorTo: gray
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: rbx3d
3
+ emoji: 🐳
4
+ colorFrom: yellow
5
  colorTo: gray
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,331 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>2D VFX to 3D FBX Converter</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .dropzone {
11
+ border: 2px dashed #4b5563;
12
+ transition: all 0.3s ease;
13
+ }
14
+ .dropzone.active {
15
+ border-color: #3b82f6;
16
+ background-color: rgba(59, 130, 246, 0.1);
17
+ }
18
+ .progress-bar {
19
+ transition: width 0.3s ease;
20
+ }
21
+ .preview-canvas {
22
+ max-width: 100%;
23
+ height: auto;
24
+ border: 1px solid #e5e7eb;
25
+ border-radius: 0.5rem;
26
+ }
27
+ .blender-viewport {
28
+ background-color: #1e293b;
29
+ border-radius: 0.5rem;
30
+ overflow: hidden;
31
+ }
32
+ .animated-mesh {
33
+ animation: pulse 2s infinite;
34
+ }
35
+ @keyframes pulse {
36
+ 0%, 100% {
37
+ opacity: 0.8;
38
+ }
39
+ 50% {
40
+ opacity: 1;
41
+ }
42
+ }
43
+ .tooltip {
44
+ position: relative;
45
+ display: inline-block;
46
+ }
47
+ .tooltip .tooltiptext {
48
+ visibility: hidden;
49
+ width: 200px;
50
+ background-color: #1f2937;
51
+ color: #fff;
52
+ text-align: center;
53
+ border-radius: 6px;
54
+ padding: 5px;
55
+ position: absolute;
56
+ z-index: 1;
57
+ bottom: 125%;
58
+ left: 50%;
59
+ transform: translateX(-50%);
60
+ opacity: 0;
61
+ transition: opacity 0.3s;
62
+ }
63
+ .tooltip:hover .tooltiptext {
64
+ visibility: visible;
65
+ opacity: 1;
66
+ }
67
+ </style>
68
+ </head>
69
+ <body class="bg-gray-900 text-gray-100 min-h-screen">
70
+ <div class="container mx-auto px-4 py-8">
71
+ <header class="mb-10">
72
+ <div class="flex flex-col md:flex-row justify-between items-center">
73
+ <div class="mb-4 md:mb-0">
74
+ <h1 class="text-3xl md:text-4xl font-bold bg-gradient-to-r from-blue-400 to-purple-600 bg-clip-text text-transparent">
75
+ 2D VFX to 3D FBX Converter
76
+ </h1>
77
+ <p class="text-gray-400 mt-2">Transform your 2D visual effects into Roblox-compatible 3D models</p>
78
+ </div>
79
+ <div class="flex space-x-2">
80
+ <button id="docs-btn" class="px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg flex items-center">
81
+ <i class="fas fa-book mr-2"></i> Documentation
82
+ </button>
83
+ <button id="settings-btn" class="px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg flex items-center">
84
+ <i class="fas fa-cog mr-2"></i> Settings
85
+ </button>
86
+ </div>
87
+ </div>
88
+ </header>
89
+
90
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
91
+ <!-- Input Section -->
92
+ <div class="bg-gray-800 rounded-xl p-6 shadow-lg">
93
+ <h2 class="text-xl font-semibold mb-4 flex items-center">
94
+ <i class="fas fa-upload mr-2 text-blue-400"></i> Input 2D VFX
95
+ </h2>
96
+
97
+ <div id="dropzone" class="dropzone rounded-lg p-8 text-center cursor-pointer mb-6">
98
+ <i class="fas fa-file-upload text-4xl text-blue-400 mb-3"></i>
99
+ <p class="text-lg">Drag & drop your 2D VFX file here</p>
100
+ <p class="text-sm text-gray-400 mt-1">Supports GIF, MP4, PNG sequences</p>
101
+ <input type="file" id="fileInput" class="hidden" accept=".gif,.mp4,.png,.jpg,.jpeg,.webp">
102
+ <button id="browseBtn" class="mt-4 px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded-lg">
103
+ Or browse files
104
+ </button>
105
+ </div>
106
+
107
+ <div id="fileInfo" class="hidden bg-gray-700 rounded-lg p-4 mb-6">
108
+ <div class="flex justify-between items-center mb-2">
109
+ <div class="flex items-center">
110
+ <i class="fas fa-file-alt text-blue-400 mr-2"></i>
111
+ <span id="fileName" class="font-medium"></span>
112
+ </div>
113
+ <span id="fileSize" class="text-sm text-gray-400"></span>
114
+ </div>
115
+ <div class="w-full bg-gray-600 rounded-full h-2.5">
116
+ <div id="uploadProgress" class="progress-bar bg-blue-600 h-2.5 rounded-full" style="width: 0%"></div>
117
+ </div>
118
+ </div>
119
+
120
+ <div class="mb-6">
121
+ <label class="block text-sm font-medium mb-2">VFX Type</label>
122
+ <div class="grid grid-cols-2 gap-3">
123
+ <button class="vfx-type-btn px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg" data-type="explosion">
124
+ <i class="fas fa-fire mr-2"></i> Explosion
125
+ </button>
126
+ <button class="vfx-type-btn px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg" data-type="magic">
127
+ <i class="fas fa-hat-wizard mr-2"></i> Magic
128
+ </button>
129
+ <button class="vfx-type-btn px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg" data-type="electric">
130
+ <i class="fas fa-bolt mr-2"></i> Electric
131
+ </button>
132
+ <button class="vfx-type-btn px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg" data-type="custom">
133
+ <i class="fas fa-sliders-h mr-2"></i> Custom
134
+ </button>
135
+ </div>
136
+ </div>
137
+
138
+ <div id="customSettings" class="hidden bg-gray-700 rounded-lg p-4 mb-6">
139
+ <h3 class="font-medium mb-3">Custom VFX Settings</h3>
140
+ <div class="space-y-4">
141
+ <div>
142
+ <label class="block text-sm font-medium mb-1">Effect Intensity</label>
143
+ <input type="range" min="1" max="10" value="5" class="w-full h-2 bg-gray-600 rounded-lg appearance-none cursor-pointer">
144
+ </div>
145
+ <div>
146
+ <label class="block text-sm font-medium mb-1">Animation Speed</label>
147
+ <input type="range" min="0.5" max="2" step="0.1" value="1" class="w-full h-2 bg-gray-600 rounded-lg appearance-none cursor-pointer">
148
+ </div>
149
+ <div>
150
+ <label class="block text-sm font-medium mb-1">Mesh Complexity</label>
151
+ <select class="w-full bg-gray-600 border border-gray-500 rounded-lg px-3 py-2 text-sm">
152
+ <option>Low (Fastest)</option>
153
+ <option selected>Medium</option>
154
+ <option>High (Best Quality)</option>
155
+ </select>
156
+ </div>
157
+ </div>
158
+ </div>
159
+
160
+ <div class="flex justify-end">
161
+ <button id="analyzeBtn" class="px-6 py-3 bg-blue-600 hover:bg-blue-700 rounded-lg font-medium flex items-center disabled:opacity-50" disabled>
162
+ <i class="fas fa-search mr-2"></i> Analyze VFX
163
+ </button>
164
+ </div>
165
+ </div>
166
+
167
+ <!-- Preview Section -->
168
+ <div class="bg-gray-800 rounded-xl p-6 shadow-lg">
169
+ <h2 class="text-xl font-semibold mb-4 flex items-center">
170
+ <i class="fas fa-eye mr-2 text-purple-400"></i> VFX Analysis
171
+ </h2>
172
+
173
+ <div id="previewContainer" class="hidden">
174
+ <div class="flex justify-between items-center mb-4">
175
+ <div>
176
+ <span class="text-sm text-gray-400">Frame:</span>
177
+ <span id="currentFrame" class="font-medium ml-1">1</span>
178
+ <span class="text-gray-400">/</span>
179
+ <span id="totalFrames" class="font-medium">24</span>
180
+ </div>
181
+ <div class="flex space-x-2">
182
+ <button id="prevFrameBtn" class="p-2 bg-gray-700 hover:bg-gray-600 rounded-lg">
183
+ <i class="fas fa-chevron-left"></i>
184
+ </button>
185
+ <button id="playPauseBtn" class="p-2 bg-gray-700 hover:bg-gray-600 rounded-lg">
186
+ <i class="fas fa-play"></i>
187
+ </button>
188
+ <button id="nextFrameBtn" class="p-2 bg-gray-700 hover:bg-gray-600 rounded-lg">
189
+ <i class="fas fa-chevron-right"></i>
190
+ </button>
191
+ </div>
192
+ </div>
193
+
194
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
195
+ <div>
196
+ <h3 class="text-sm font-medium mb-2">Original Frame</h3>
197
+ <canvas id="originalCanvas" class="preview-canvas w-full" width="300" height="300"></canvas>
198
+ </div>
199
+ <div>
200
+ <h3 class="text-sm font-medium mb-2">Alpha Channel</h3>
201
+ <canvas id="alphaCanvas" class="preview-canvas w-full" width="300" height="300"></canvas>
202
+ </div>
203
+ </div>
204
+
205
+ <div class="bg-gray-700 rounded-lg p-4 mb-6">
206
+ <h3 class="font-medium mb-3">Analysis Results</h3>
207
+ <div class="grid grid-cols-2 gap-4">
208
+ <div>
209
+ <p class="text-sm text-gray-400">Effect Type</p>
210
+ <p id="effectType" class="font-medium">-</p>
211
+ </div>
212
+ <div>
213
+ <p class="text-sm text-gray-400">Frame Count</p>
214
+ <p id="frameCount" class="font-medium">-</p>
215
+ </div>
216
+ <div>
217
+ <p class="text-sm text-gray-400">Dimensions</p>
218
+ <p id="dimensions" class="font-medium">-</p>
219
+ </div>
220
+ <div>
221
+ <p class="text-sm text-gray-400">Color Profile</p>
222
+ <p id="colorProfile" class="font-medium">-</p>
223
+ </div>
224
+ </div>
225
+ </div>
226
+
227
+ <div class="flex justify-between">
228
+ <button id="advancedBtn" class="px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg flex items-center">
229
+ <i class="fas fa-sliders-h mr-2"></i> Advanced Settings
230
+ </button>
231
+ <button id="generateBtn" class="px-6 py-3 bg-purple-600 hover:bg-purple-700 rounded-lg font-medium flex items-center">
232
+ <i class="fas fa-cube mr-2"></i> Generate 3D Model
233
+ </button>
234
+ </div>
235
+ </div>
236
+
237
+ <div id="emptyPreview" class="text-center py-12">
238
+ <i class="fas fa-film text-4xl text-gray-600 mb-4"></i>
239
+ <p class="text-gray-400">Upload and analyze a 2D VFX to see preview</p>
240
+ </div>
241
+ </div>
242
+ </div>
243
+
244
+ <!-- 3D Generation Section -->
245
+ <div id="generationSection" class="hidden mt-10 bg-gray-800 rounded-xl p-6 shadow-lg">
246
+ <h2 class="text-xl font-semibold mb-6 flex items-center">
247
+ <i class="fas fa-cube mr-2 text-green-400"></i> 3D Model Generation
248
+ </h2>
249
+
250
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
251
+ <div class="lg:col-span-2">
252
+ <div class="blender-viewport h-96 relative">
253
+ <div id="blenderViewport" class="w-full h-full flex items-center justify-center">
254
+ <div class="text-center">
255
+ <i class="fas fa-spinner fa-spin text-4xl text-gray-500 mb-3"></i>
256
+ <p class="text-gray-400">Generating 3D model...</p>
257
+ </div>
258
+ </div>
259
+ <div class="absolute bottom-4 left-4 bg-black bg-opacity-70 px-3 py-1 rounded-lg text-sm">
260
+ <span id="generationProgress">0%</span> Complete
261
+ </div>
262
+ </div>
263
+
264
+ <div class="mt-4 grid grid-cols-3 gap-2">
265
+ <button id="viewWireframe" class="p-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm">
266
+ <i class="fas fa-border-none mr-1"></i> Wireframe
267
+ </button>
268
+ <button id="viewSolid" class="p-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-sm">
269
+ <i class="fas fa-square mr-1"></i> Solid
270
+ </button>
271
+ <button id="viewMaterial" class="p-2 bg-blue-600 rounded-lg text-sm">
272
+ <i class="fas fa-paint-brush mr-1"></i> Material
273
+ </button>
274
+ </div>
275
+ </div>
276
+
277
+ <div>
278
+ <div class="bg-gray-700 rounded-lg p-4 mb-6">
279
+ <h3 class="font-medium mb-3">3D Model Details</h3>
280
+ <div class="space-y-3">
281
+ <div>
282
+ <p class="text-sm text-gray-400">Mesh Type</p>
283
+ <p id="meshType" class="font-medium">Particle System</p>
284
+ </div>
285
+ <div>
286
+ <p class="text-sm text-gray-400">Vertex Count</p>
287
+ <p id="vertexCount" class="font-medium">1,248</p>
288
+ </div>
289
+ <div>
290
+ <p class="text-sm text-gray-400">Texture Size</p>
291
+ <p id="textureSize" class="font-medium">1024×1024</p>
292
+ </div>
293
+ <div>
294
+ <p class="text-sm text-gray-400">Animation Frames</p>
295
+ <p id="animFrames" class="font-medium">24</p>
296
+ </div>
297
+ </div>
298
+ </div>
299
+
300
+ <div class="bg-gray-700 rounded-lg p-4 mb-6">
301
+ <h3 class="font-medium mb-3">Export Settings</h3>
302
+ <div class="space-y-3">
303
+ <div>
304
+ <label class="flex items-center">
305
+ <input type="checkbox" class="rounded bg-gray-600 border-gray-500 mr-2" checked>
306
+ <span class="text-sm">Include Animation</span>
307
+ </label>
308
+ </div>
309
+ <div>
310
+ <label class="flex items-center">
311
+ <input type="checkbox" class="rounded bg-gray-600 border-gray-500 mr-2" checked>
312
+ <span class="text-sm">Optimize for Roblox</span>
313
+ </label>
314
+ </div>
315
+ <div>
316
+ <label class="flex items-center">
317
+ <input type="checkbox" class="rounded bg-gray-600 border-gray-500 mr-2">
318
+ <span class="text-sm">Generate Collision Mesh</span>
319
+ </label>
320
+ </div>
321
+ <div>
322
+ <label class="block text-sm font-medium mb-1">Scale Factor</label>
323
+ <input type="number" value="1.0" step="0.1" class="w-full bg-gray-600 border border-gray-500 rounded-lg px-3 py-2 text-sm">
324
+ </div>
325
+ </div>
326
+ </div>
327
+
328
+ <button id="exportBtn" class="w-full px-6 py-3 bg-green-600 hover:bg-green-700 rounded-lg font-medium flex items-center justify-center">
329
+ <i class="fas fa-file-export mr-2"></i> Export FBX for
330
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Dismissive/rbx3d" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
331
+ </html>