Articles on xtanion's Bloghttps://blogs.python-gsoc.orgUpdates on different articles published on xtanion's BlogenMon, 10 Oct 2022 12:28:26 +0000Week 14 - Morphing is here!https://blogs.python-gsoc.org/en/xtanions-blog/week-14-morphing-is-here/<h2>What did you do this week?</h2> <ul> <li>This week, I started with Multiple actor support in skinning and managed to do it successfully. Here's the preview using the BrainStem model.</li> </ul> <p>&lt;iframe height="340" src="https://user-images.githubusercontent.com/74976752/193109340-2e37c255-139b-499f-a932-b8c0290bb481.mp4" width="600"&gt;&lt;/iframe&gt;</p> <ul> <li>Implementing multiple animation channels support (as seen in the <code>Fox</code> model). The <code>get_skin_timelines()</code> method now returns a dictionary of all animation channels with Timeline as their value.</li> <li>We merged two PRs, <a href="https://github.com/fury-gl/fury/pull/689/">#689</a> (colors from Material) and <a href="https://github.com/fury-gl/fury/pull/643/">#643</a> (simple animations).</li> <li>Added ability to load morphing information and create timelines from it. Here's a preview of the <code>AnimatedMorphCube</code> and <code>AnimatedMorphSphere</code> models:</li> </ul> <p>&lt;iframe height="340" src="https://user-images.githubusercontent.com/74976752/192871376-881fbdd6-2fab-4a7f-9f4f-07663d93561c.mp4" width="600"&gt;&lt;/iframe&gt;</p> <h2>What is coming up next week?</h2> <ul> <li>Cleaning and Rebasing Skinning animation PR <a href="https://github.com/fury-gl/fury/pull/685/">#685</a>.</li> <li>Creating a PR for morphing code.</li> <li>Multi primitive (actor) support in morphing.</li> </ul> <h2>Did you get stuck anywhere?</h2> <ul> <li>No, I didn't get stuck this week.</li> </ul>anandshivam54321@gmail.com (xtanion)Mon, 10 Oct 2022 12:28:26 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-14-morphing-is-here/Week 13 - Multi-bone skeletal animation supporthttps://blogs.python-gsoc.org/en/xtanions-blog/week-13-multi-bone-skeletal-animation-support/<h2>What did you do this week?</h2> <p>This week I fixed all the issues with skeletal animations, and we got to see our first render of skeletal animation :).</p> <ul> <li>Implemented a hierarchical timeline system (i.e., one timeline for each bone, and the timeline will contain its parent timeline in a hierarchy).</li> </ul> <p>- I figured out that we don't need to apply the parent transform as we're applying it to the vertex data while forming the actor. So the skin matrix becomes <code>SkinMatrix = InverseBindPose * BoneDeform</code> where <code>BoneDeform = CurrentBoneTransform * ParentBonetransform</code>.</p> <p>Here's a preview using the <code>CesiumMan</code> model:<iframe height="360" src="https://www.youtube.com/embed/79JVUH5GYVA" width="640"></iframe></p> <h2>What is coming up next week?</h2> <ul> <li>Add tests for simple animation PR <a href="https://github.com/fury-gl/fury/pull/643/">#643</a>.</li> <li>Multiple actor support for skeletal animation.</li> <li>Take a look at Morphing.</li> </ul> <h2>Did you get stuck anywhere?</h2> <ul> <li>No, I didn't get stuck this week.</li> </ul>anandshivam54321@gmail.com (xtanion)Tue, 20 Sep 2022 20:33:59 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-13-multi-bone-skeletal-animation-support/Week 12 - Adding skeleton as actors and fix global transformationhttps://blogs.python-gsoc.org/en/xtanions-blog/week-12-adding-skeleton-as-actors-and-fix-global-transformation/<h2>What did you do this week?</h2> <ul> <li>I started this week by fixing the segmentation fault for the skinning test. I could not fix this as of now.</li> <li>I imported the <code>RiggedFigure</code> model into the Blender and I was quite impressed with how it visualizes each bone. So, I created a function that creates an arrow actor in place of a bone, and by applying the correct transformation, we get the bones of a model in place. Here's a quick preview of bones in Blender vs bones in FURY:</li> </ul> <p><img alt="image" class="align-center" src="https://user-images.githubusercontent.com/74976752/189194609-e55f6285-b5ed-4eb3-9e78-5fb462fb2dee.png" width="500"></p> <p><img alt="image" class="align-center" src="https://user-images.githubusercontent.com/74976752/189195853-5b1f8945-9822-48f5-8d55-f13e822a43a7.png" width="500"></p> <ul> <li>After having the bones actor, I noticed that some bones are not aligned correctly. It was happening due to multiplication of the same transformation matrix twice.</li> <li>I also created a function that calculates the total transformation of a node, it eliminates the need to use <code>timeline.get_value</code> in <code>get_skin_timeline</code> function.</li> </ul> <h2>What is coming up next week?</h2> <ul> <li>It seems like I fixed everything, but we are not getting the correct model at timestamp 0. We need to find the cause and fix it!</li> <li>Cleaning the Simple Animation PR <a href="https://github.com/fury-gl/fury/pull/643/">#643</a>, and merging it.</li> </ul> <h2>Did you get stuck anywhere?</h2> <ul> <li>While applying the timeline, we were getting the identity matrix for timestamp 0.0s, it was set to a new value before. We figured this in our meeting that it's happening due to some model's animation not starting from 0.0s.</li> </ul> <p><img alt="image" class="align-center" src="https://user-images.githubusercontent.com/74976752/189196234-b28f86f7-223b-40e4-94bf-2ec18d914487.png" width="400"></p>anandshivam54321@gmail.com (xtanion)Tue, 20 Sep 2022 20:32:00 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-12-adding-skeleton-as-actors-and-fix-global-transformation/Week 11 - Multiple transformations support and adding testshttps://blogs.python-gsoc.org/en/xtanions-blog/week-11-multiple-transformations-support-and-adding-tests/<h2>What did you do this week?</h2> <p>As decided last week, I added support for multiple animations at the same timestamp. But this didn't solve the animation problems of <code>RiggedSimple</code> model.</p> <ul> <li> <p>I figured out that I was not applying the global transform of joints in the skinning matrix causing the joints to move to a new position. I referred to this <a href="https://www.gamedev.net/forums/topic/703803-gltf-skinning-matrix-calculation/">answer by irradicator</a>.</p> </li> <li> <p>We had to invert the multiplication order (ie, <code>np.dot(skin_mat, vertex)</code> instead of <code>np.dot(vertex, skin_mat)</code>) for this model. We still need to figure out from where we get the multiplication order of the two.</p> <blockquote>&lt;iframe height="390" src="https://user-images.githubusercontent.com/74976752/187798821-7306cb13-dfc8-477c-8f86-1f5a6181f08a.mp4" width="600"&gt;&lt;/iframe&gt;</blockquote> </li> <li> <p>I also tried to create a custom Interpolator that does all calculations required for vertex skinning. However, we couldn't get this working. I got a few suggestions from Mohamed in our meeting, I'll try to implement those.</p> </li> <li> <p>Added tests for animations.</p> </li> </ul> <h2>What is coming up next week?</h2> <ul> <li>Adding more tests.</li> <li>Fixing the Interpolator.</li> <li>Order of multiplication in the skinning matrix.</li> </ul> <h2>Did you get stuck anywhere?</h2> <p>No, I didn't get stuck this week.</p>anandshivam54321@gmail.com (xtanion)Tue, 20 Sep 2022 20:30:14 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-11-multiple-transformations-support-and-adding-tests/Week 10 - Multi-node skinning supporthttps://blogs.python-gsoc.org/en/xtanions-blog/week-10-multi-node-skinning-support/<h1>What did you do this week?</h1> <p>As we figured out that the <code>SimpleSkin</code> model is not animated as intended. This week I started working with that model; I figured out that we need to apply the InverseBindMatrix to each timer callback. I had a hard time figuring out what inverse bind matrix actually does. Here's a good <a href="https://stackoverflow.com/questions/17127994/opengl-bone-animation-why-do-i-need-inverse-of-bind-pose-when-working-with-gp">blog</a> that answers that.</p> <p><strong>In short: The InverseBindMatrix "undoes" any transformation that has already been applied to your model in its bind pose.</strong> Note: Inverse bind matrix shouldn't be applied with weights.</p> <ul> <li> <p>I got the <code>SimpleSkin</code> model to work perfectly. Here's a preview:<iframe height="360" src="https://www.youtube.com/embed/y_HXLIzmi98" width="640"></iframe></p> </li> <li> <p>Support for multiple transformations is still missing. However <code>RiggedSimple</code> is also working fine, except that It doesn't interpolate translation and scaling matrices.<iframe height="360" src="https://www.youtube.com/embed/kV3Bf8hFVoY" width="640"></iframe></p> </li> </ul> <h1>What is coming up next week?</h1> <ul> <li>Adding tests and adding support for combining transformation matrices for the same timestamp.</li> <li>Write an Interpolator that applies skinning to the mesh internally.</li> </ul> <h1>Did you get stuck anywhere?</h1> <p>No, I didn't get stuck this week.</p>anandshivam54321@gmail.com (xtanion)Thu, 01 Sep 2022 00:45:55 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-10-multi-node-skinning-support/Week 9 - First working skeletal animation prototypehttps://blogs.python-gsoc.org/en/xtanions-blog/week-9-first-working-skeletal-animation-prototype/<h1>What did you do this week?</h1> <ul> <li> <p>This week I had the first working <a href="https://github.com/xtanion/fury/blob/gltf-skin-test/docs/tutorials/01_introductory/viz_skinning.py">example</a> of skeletal animation ready. I was able to render the <a href="https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/SimpleSkin">SimpleSkin</a> model. Here's a quick preview:</p> <blockquote>&lt;iframe height="390" src="https://user-images.githubusercontent.com/74976752/184981715-a83a8a36-f2bf-4ff1-9366-0c302dcf3f9b.mp4" width="600"&gt;&lt;/iframe&gt;</blockquote> </li> <li>I wrote a custom <a href="https://github.com/xtanion/fury/blob/gltf-skin-test/fury/gltf.py#L693">interpolator</a> (just like the tangent cubic spline interpolator) for interpolating two transformation matrices.</li> </ul> <h1>What is coming up next week?</h1> <ul> <li>Generalising the skinning code to work with other models as well (it supports only the <code>SimpleSkin</code> model as of now).</li> <li>Creating a custom interpolator to interpolate more than 4 matrices at once.</li> </ul> <h1>Did you get stuck anywhere?</h1> <p>No, I didn't get stuck this week.</p>anandshivam54321@gmail.com (xtanion)Wed, 24 Aug 2022 14:47:44 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-9-first-working-skeletal-animation-prototype/Week 8 - Fixing animation bugshttps://blogs.python-gsoc.org/en/xtanions-blog/week-8-fixing-animation-bugs/<h1>What did you do this week?</h1> <p>This week I had to fix the transformation issue in glTF animation. As discussed in the last meeting, I disabled vertex transformation and applied the transformation after the actor was formed.</p> <ul> <li> <p>Creating transformation matrix using the TRS data from nodes.</p> </li> <li> <p>Extract Translation, Rotation, and Scale matrices from the transformation matrix.</p> &lt;iframe height="360" src="https://user-images.githubusercontent.com/74976752/184015060-48d79f0d-1377-4f69-b147-cd53448ccf02.mp4" width="640"&gt;&lt;/iframe&gt;</li> </ul> <p>I also started investigating more on the skinning animation.</p> <ul> <li>I created functions to extract and apply the <code>InvertBindMatrices</code> to the vertices.</li> <li>Also, applying the <code>globalTransformMatrices</code> to the mesh.</li> </ul> <h1>What is coming up next week?</h1> <ul> <li>Skeletal animations support</li> </ul> <h1>Did you get stuck anywhere?</h1> <ul> <li> <p>Even after applying the transformation to the actor, after it's created. Some models did not behave as intended. We still need to figure this issue out and fix it.</p> &lt;iframe height="360" src="https://user-images.githubusercontent.com/74976752/184015110-035f1ce7-5a5c-4480-b49c-ae575d4b7ccd.mp4" width="640"&gt;&lt;/iframe&gt;</li> </ul>anandshivam54321@gmail.com (xtanion)Wed, 24 Aug 2022 14:32:31 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-8-fixing-animation-bugs/Week 7 - Fixing bugs in animationshttps://blogs.python-gsoc.org/en/xtanions-blog/week-7-fixing-bugs-in-animations/<h1>What did you do this week?</h1> <ul> <li> <p>This week I started with implementing scaling to the animation example.</p> </li> <li> <p>I had a meeting with Mohamed in which we discussed the rotation issue, and we found out that glTF uses <code>Slerp</code> interpolator instead of the <code>LinearInterpolator</code>. Using <code>Slerp</code> interpolator for rotation fixed the rotation issue.</p> </li> <li> <p>Another issue we faced was with the multi-actor system. Some actors weren't rotating or translating as intended. This was caused because the transformations were applied to the <code>polydata</code> before creating an actor; Mohamed suggested applying transformation after the actor is created from polydata (keeping the center to origin).</p> <iframe height="360" src="https://www.youtube.com/embed/lwtbefCqzkc" width="640"></iframe></li> </ul> <p>Expected animation: <a href="https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/InterpolationTest">Interpolation Test Sample</a></p> <ul> <li>Created functions to return a list of animation timelines and apply them to the main timeline for keyframe animations.</li> <li><code>CubicSpline</code> has not been implemented to glTF animation yet since it works differently than other Interpolators (takes tangent input to smoothen the curve) but it'll be done before our next meeting.</li> </ul> <h1>What is coming up next week?</h1> <ul> <li>Adding skinning animations support</li> </ul> <h1>Did you get stuck anywhere?</h1> <p>I still need to figure out how to apply the transformation matrix to the actor and not to the polydata.</p>anandshivam54321@gmail.com (xtanion)Tue, 09 Aug 2022 21:43:20 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-7-fixing-bugs-in-animations/Week 6 - Extracting the animation datahttps://blogs.python-gsoc.org/en/xtanions-blog/week-6-extracting-the-animation-data/<h2>What did you do this week?</h2> <ul> <li> <p>This week, it was all about reading docs and extracting the animation data from buffers.</p> </li> <li> <p>Currently, the glTF class can extract simple node transformation and morphing data, as they are stored in the <code>Animations</code> of the glTF file.</p> </li> <li> <p>Skinning (Skeletal Animation) data is stored in <code>Nodes</code> inside the skin parameter. We shall be able to load that before our next meeting on Wednesday.</p> </li> <li> <p>Created a <a href="https://github.com/xtanion/fury/blob/gltf-anim-merge-kf/docs/tutorials/01_introductory/viz_simple_gltf_animation.py">tutorial</a> using keyframe animations (<a href="https://github.com/fury-gl/fury/pull/626">#626</a>) and adding multiple <code>timelines</code> into a main <code>timeline</code> as suggested by Mohamed.</p> &lt;iframe height="400" src="https://user-images.githubusercontent.com/74976752/180841262-7356204e-2097-4ea4-ab71-39f04a1e7a07.mp4" width="550"&gt;&lt;/iframe&gt;</li> </ul> <h2>What is coming up next week?</h2> <p>As of now, we've decided the following:</p> <ul> <li>Create a custom Interpolator (for simple node transformations, morph and Skeletal animations).</li> </ul> <h2>Did you get stuck anywhere?</h2> <p>No, I didn't get stuck this week.</p>anandshivam54321@gmail.com (xtanion)Tue, 02 Aug 2022 18:05:40 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-6-extracting-the-animation-data/Week 5 - Creating PR for glTF exporter and fixing the loaderhttps://blogs.python-gsoc.org/en/xtanions-blog/week-5-creating-pr-for-gltf-exporter-and-fixing-the-loader/<h1>What did you do this week?</h1> <ul> <li>Finalised the glTF export PR <a href="https://github.com/fury-gl/fury/pull/630">#630</a>., adding tutorial, docs, and tests for all functions.</li> <li>Added support for exporting lines and dot actors.</li> <li><code>primitive.modes</code> is now set if the rendering mode is a line, dot, or triangle.</li> <li>Working on importing different primitive modes, the current glTF importer can render only triangles.</li> </ul> <h1>What is coming up next week?</h1> <p>This week I'll be working on the following:</p> <ul> <li>Get the PR <a href="https://github.com/fury-gl/fury/pull/630">#630</a>. merged by this week.</li> <li>Loading the animations (simple, morph, and skeletal) data as dictionaries from the glTF model so that it can be sent to the timeline.</li> <li>Try different examples on Mohamed's PR (<a href="https://github.com/fury-gl/fury/pull/626">#626</a>.) and try running glTF animations if time permits.</li> </ul> <h1>Did you get stuck anywhere?</h1> <ul> <li>There wasn't any model in the Khronos glTF samples repository that uses the <code>LINE</code> or <code>POINT</code> modes. So I had to rely on the models that I exported using the glTF exporter.</li> </ul>anandshivam54321@gmail.com (xtanion)Mon, 25 Jul 2022 16:43:32 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-5-creating-pr-for-gltf-exporter-and-fixing-the-loader/Week 4 - Finalizing glTF loaderhttps://blogs.python-gsoc.org/en/xtanions-blog/week-4-finalizing-gltf-loader/<h2>What did you do this week?</h2> <p>This week I had to travel back to my college since the summer vacations have ended. I had a coding session with Serge this week, we modified the exporter function and looked at some bugs I faced.</p> <p>We managed to use the <code>io.load_io</code> function. There was a strange issue with loading png files. I had to convert the PIL <code>Image</code> to <code>RGB</code> format, and it fixed the issue, turns out png images are stored as <code>P</code> (pallet) mode.</p> <p>I also added the <code>glb</code> format support to the importer. While loading a <code>.glb</code> model, I noticed that the image data is also stored in the buffer and there can be a <code>bufferview</code> index to get the buffer.</p> <p>During this time, I also tested the glTF loader with all models in the <code>KhronoosGroup/glTF-samples</code> repository. Here's the table of models working well: <a href="https://github.com/xtanion/Blog-Items/blob/main/glTF-models-status.csv">see file</a>.</p> <table> <tbody> <tr class="header"> <th>Model Name</th> <th>Status</th> <th>Error Type</th> </tr> </tbody> <tbody> <tr class="odd"> <td>BoxInterleaved</td> <td>No</td> <td>"BoxInterleaved.gltf: shapes (4,4) and (7,12) not aligned: 4 (dim 1) != 7 (dim 0)"</td> </tr> <tr class="even"> <td>Box</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>SpecularTest</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>AnimatedCube</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>NormalTangentMirrorTest</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>AnimatedTriangle</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>SpecGlossVsMetalRough</td> <td>No</td> <td>SpecGlossVsMetalRough.gltf: 'NoneType' object has no attribute 'baseColorTexture'</td> </tr> <tr class="even"> <td>CesiumMilkTruck</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>VC</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>WaterBottle</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>AnimatedMorphCube</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>Sponza</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>SciFiHelmet</td> <td>No</td> <td>SciFiHelmet.gltf: Python int too large to convert to C long</td> </tr> <tr class="even"> <td>Triangle</td> <td>No</td> <td>None: file not downloaded</td> </tr> <tr class="odd"> <td>IridescenceMetallicSpheres</td> <td>No</td> <td>None: file not downloaded</td> </tr> <tr class="even"> <td>Corset</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>Cube</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>TextureLinearInterpolationTest</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>SimpleMeshes</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>Lantern</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>TextureTransformMultiTest</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>TextureSettingsTest</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>LightsPunctualLamp</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>DamagedHelmet</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>CesiumMan</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>Cameras</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>BarramundiFish</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>MetalRoughSpheresNoTextures</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>EnvironmentTest</td> <td>No</td> <td>None: file not downloaded</td> </tr> <tr class="even"> <td>MosquitoInAmber</td> <td>No</td> <td>MosquitoInAmber.gltf: buffer is smaller than requested size</td> </tr> <tr class="odd"> <td>BoxTexturedNonPowerOfTwo</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>BrainStem</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>SimpleMorph</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>OrientationTest</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>BoxAnimated</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>StainedGlassLamp</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>TextureTransformTest</td> <td>No</td> <td>None: file not downloaded</td> </tr> <tr class="even"> <td>ClearCoatTest</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>IridescenceLamp</td> <td>No</td> <td>None: file not downloaded</td> </tr> <tr class="even"> <td>DragonAttenuation</td> <td>No</td> <td>DragonAttenuation.gltf: buffer is smaller than requested size</td> </tr> <tr class="odd"> <td>RecursiveSkeletons</td> <td>No</td> <td>RecursiveSkeletons.gltf: cannot reshape array of size 120 into shape (9)</td> </tr> <tr class="even"> <td>Suzanne</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>RiggedSimple</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>TextureEncodingTest</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>2CylinderEngine</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>NormalTangentTest</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>MorphStressTest</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>IridescenceDielectricSpheres</td> <td>No</td> <td>None: file not downloaded</td> </tr> <tr class="odd"> <td>TextureCoordinateTest</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>Duck</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>AlphaBlendModeTest</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>TriangleWithoutIndices</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>MultiUVTest</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>BoomBoxWithAxes</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>Box With Spaces</td> <td>No</td> <td>Box%20With%20Spaces.gltf: 'NoneType' object has no attribute 'shape'</td> </tr> <tr class="even"> <td>SheenCloth</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>ToyCar</td> <td>No</td> <td>None: file not downloaded</td> </tr> <tr class="even"> <td>MaterialsVariantsShoe</td> <td>No</td> <td>MaterialsVariantsShoe.gltf: buffer is smaller than requested size</td> </tr> <tr class="odd"> <td>IridescentDishWithOlives</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>VertexColorTest</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>SheenChair</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>Fox</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>AntiqueCamera</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>TransmissionTest</td> <td>No</td> <td>None: file not downloaded</td> </tr> <tr class="odd"> <td>TransmissionRoughnessTest</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>BoxVertexColors</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>ReciprocatingSaw</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>MorphPrimitivesTest</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>MetalRoughSpheres</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>GearboxAssy</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>TwoSidedPlane</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>Buggy</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>SimpleSparseAccessor</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>BoxTextured</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>UnlitTest</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>SimpleSkin</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>FlightHelmet</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>Unicode❤♻Test</td> <td>No</td> <td>Unicode%E2%9D%A4%E2%99%BBTest.gltf: 'NoneType' object has no attribute 'shape'</td> </tr> <tr class="odd"> <td>Avocado</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>InterpolationTest</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>GlamVelvetSofa</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>RiggedFigure</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>BoomBox</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>EmissiveStrengthTest</td> <td>No</td> <td>None: file not downloaded</td> </tr> <tr class="odd"> <td>AttenuationTest</td> <td>Yes</td> <td> </td> </tr> <tr class="even"> <td>AnimatedMorphSphere</td> <td>Yes</td> <td> </td> </tr> <tr class="odd"> <td>IridescenceSuzanne</td> <td>Yes</td> <td> </td> </tr> </tbody> </table> <h2>What is coming up next week?</h2> <ul> <li>Adding tests and merging export function PR.</li> <li>Start working on Simple Animations.</li> </ul> <h2>Did you get stuck anywhere?</h2> <ul> <li> <p>To create a texture, we needed the RGB values, However <code>.png</code> images were returning a 2D array when read using PIL. It is fixed by</p> <blockquote> </blockquote> </li> <li> <p>pygltflib's <code>load</code> method doesnot handle glb files very well. It does not contain the buffer <code>uri</code>. I used <code>glb2gltf</code> method as of now.</p> </li> </ul>anandshivam54321@gmail.com (xtanion)Tue, 19 Jul 2022 14:36:49 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-4-finalizing-gltf-loader/Week 3 - Fixing fetcher, adding tests and docshttps://blogs.python-gsoc.org/en/xtanions-blog/week-3-fixing-fetcher-adding-tests-and-docs/<h2>What did you do this week?</h2> <ul> <li>The first task for this week was to fix the glTF fetcher. We noticed that while running tests it reaches the API limit. So we decided to use a JSON file that contains the download URLs for all models.</li> <li>Created a function to generate JSON files with download URLs for all models, which can be found <a href="https://github.com/xtanion/fury/blob/gltf-json-gen/fury/data/fetcher.py#L330">here</a>.</li> <li>Modified the tests and <code>fetcher.py</code> to download using the JSON URLs and merged the PR <a href="https://github.com/fury-gl/fury/pull/616">#616</a>.</li> <li>Added docstring for all functions in <a href="https://github.com/fury-gl/fury/pull/600">#600</a>. Wrote tests for transformation functions.</li> <li>Multiple actor support in glTF export. Added tutorial and created a new branch for the same. Here's an example: (The glTF model below is created using FURY and rendered back using the glTF class)</li> </ul> <p><img alt="image" class="align-center" src="https://github.com/xtanion/Blog-Images/blob/main/Screenshot%20from%202022-07-05%2014-51-06.png?raw=true" width="500"></p> <h2>What is coming up next week?</h2> <p>I will be doing the following:</p> <ul> <li>We still need to figure out how to get indices from <code>vtkSource</code> actors</li> <li>I'll be finishing the exporting functions and adding tests for the same and I should be able to create a mergeable PR for the exporting function.</li> </ul> <p>Other tasks will be decided after the meeting.</p> <h2>Did you get stuck anywhere?</h2> <p>No</p>anandshivam54321@gmail.com (xtanion)Fri, 08 Jul 2022 16:10:58 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-3-fixing-fetcher-adding-tests-and-docs/Week 2 - Improving Fetcher and Exporting glTFhttps://blogs.python-gsoc.org/en/xtanions-blog/week-2-improving-fetcher-and-exporting-gltf/<h2>What did you do this week?</h2> <p>This week I worked primarily on the glTF fetcher and exporting scenes to a glTF file. I added tests and docstrings for all functions. I modified the <code>fetch_gltf</code> function to return the downloaded files. As we planned, the PR for the glTF fetcher was merged this week.</p> <p>I fixed the color issue of the glTF exporter by manually appending the color data from the actor to the <code>polydata</code>. But there's another issue raised while using actors from <code>vtkSource</code>. The <code>utils.get_polydata_triangles(polydata)</code> method only works with primitives and it raises an error when used with <code>vtkSource</code> actors.</p> <p>Textures and Cameras can now be added to the glTF file. However, it supports baseTexture only. I'll be working on materials support later on.</p> <h2>What is coming up next week?</h2> <ul> <li>Saving all models download link (from the Khronos glTF-Samples-Models repository) to a JSON file, create a separate branch and add the download script.</li> <li>Add tests and docstring for PR <a href="https://github.com/fury-gl/fury/pull/600">#600</a>.</li> <li>Create a PR for glTF exporter.</li> </ul> <h2>Did you get stuck anywhere?</h2> <ul> <li>I managed to fix colors in polydata by adding them manually, but it raised another issue with indices (triangles) of the actor weren't of the correct shape. We decided to take a look at it later.</li> <li>Due to Github's API limit, it raised an error due to limits exceeding. We decided to save a JSON file with all model names and their download links. Then use that to download the model.</li> </ul>anandshivam54321@gmail.com (xtanion)Mon, 04 Jul 2022 10:23:21 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-2-improving-fetcher-and-exporting-gltf/Week 1 - A Basic glTF Importerhttps://blogs.python-gsoc.org/en/xtanions-blog/week-1-a-basic-gltf-importer/<h2>What did you do during the Community Bonding Period?</h2> <p>In the community bonding period I met with my mentor Serge Koudoro, along with other mentors in FURY and gsoc contributors. We discussed about my project and set up project timeline on github projects section. As my project (glTF Integration) and Keyframe animations were related so we discussed on that too.</p> <p>I read documentation of various glTF loading libraries (<code>pygltflib</code>, <code>panda3D-gltf</code> and <code>pyrender</code>) in python and tried to understand how do they work. I started creating a basic glTF loader, it was using dataclasses to store json data. I created polydata for each primitive in a mesh, each polydata will contain the vertices, triangles, normals. To apply textures properly, I had to apply texture coordinates to polydata and flip the texture along X axis by 90 degrees.</p> <h2>What did you do this week?</h2> <p>After discussing on pros and cons of various glTF libraries we decided to use <code>pygltflib</code> to handle json to python dataclass conversion. This week I reshaped PR <a href="https://github.com/fury-gl/fury/pull/600/">#600</a> to use pygltflib. I also modified the code to handle multiple base textures. While experimenting with textures, I accidentally applied normals to the polydata and discovered that it makes the surface look much smoother, however in few models it results in a darker model which reflects almost no light. So I made it optional for now to apply normals in a model.</p> <p>I also created a basic fetcher (PR <a href="https://github.com/fury-gl/fury/pull/602/">#602</a>) to get glTF models from Khronos group's glTF sample repository. I also made this function asynchronous, as Serge suggested me to use asyncio and aiohttp to make the API callbacks asynchronous and it decreased the downloading time of multiple models.</p> <p>I am also working on exporting scene to a glTF file. Using <span class="title-ref">pygltflib</span> I am converting the python dataclass to a json like structure.</p> <h2>What is coming up next week?</h2> <p>Create a PR for the fetcher function, add tests, fix bugs and merge it by the end of the week. Fix the colors issue in the glTF exporter. Add texture and camera in glTF exporter and create a PR for it.</p> <h2>Did you get stuck anywhere?</h2> <ul> <li><code>var: list[int]</code> was causing the error <code>TypeError: 'type' object is not subscriptable</code> since the ability to use the [] operator on types like list was added in 3.9+. I had to modify the dataclasses and use <code>Typing.List</code> instead.</li> <li>Texture in actors weren't applied correctly. I tried flipping the texture image by 90 degrees using gimp and the texture worked nicely. The reason for this issue was the coordinate system of glTF texture format which has origin (0, 0) at top-left and (1, 1) in the bottom-right corner, Where as in vtkTexture we want coordinate (0, 0) and (1, 1) at bottom-left and top-right corner respectively. Here's an example of the issue:</li> </ul> <p style="text-align: center;"><img alt="image" class="align-center" src="https://raw.githubusercontent.com/xtanion/Blog-Images/main/-1_orig.jpg" width="500"></p> <ul> <li>Praneeth told me that some models with multiple nodes and multiple meshes weren't loading correctly. The reason for it was the way SCALAR data was extracted from the binary blob, I had to change some variables in <span class="title-ref">get_accessor_data</span> method and everything started to work just fine.</li> </ul>anandshivam54321@gmail.com (xtanion)Wed, 29 Jun 2022 15:02:07 +0000https://blogs.python-gsoc.org/en/xtanions-blog/week-1-a-basic-gltf-importer/My Journey to GSoC 2022https://blogs.python-gsoc.org/en/xtanions-blog/my-journey-to-gsoc-2022-1/<h2>About Me</h2> <p>Hi! I'm Shivam, currently pursuing my bachelor's (expected 2024) in Production and Industrial engineering from the Indian Institute of Technology (IIT) Roorkee.</p> <p>I was introduced to the C programming language through the Introduction to programming course in my first year of college. I always liked computers, and I was overwhelmed by printing "hello world" in the terminal. The course continued to teach us data structures and algorithms. It was a lot of fun competing with friends over a programming question. I learned python on my own and did a lot of projects. After learning basic programming, I participated in many hackathons and won some, but lost a lot. Coding was enjoyable, and I knew this was what I wanted to do for the rest of my life. In my second semester, I learned about open-source, git, and GitHub. I came across some computer graphics enthusiasts in my college; they told me that they created a 2D game engine on their own using OpenGL. This gave me enough motivation to learn OpenGL and basic computer graphics.</p> <h2>Intro to Open-Source and GSoC</h2> <p>In October 2021, I participated in <strong>Hactoberfest</strong> and completed it successfully. I learned a lot about Free and Open Source Software during this time. I heard about GSoC around this time from one of my seniors and asked him about the program.</p> <p>I went through the previous year's accepted organizations list and shortlisted 2-3 organizations. I started contributing to a few projects based on android and Kotlin, but I lost interest after some time. It was about December, and I hadn't chosen any organization yet.</p> <p>I heard about FURY from one of my seniors. I started looking at its docs. Picked up some books from the library to brush up on my concepts of computer graphics. The documentation of FURY is remarkable. I created my <a href="https://github.com/fury-gl/fury/pull/520">first pull request</a> by improving one of the tutorials, and It got merged in a few days.</p> <p>I started looking at the source code of FURY and tried to understand it again. I read the <span class="title-ref">API reference</span> part of FURY docs this time along with the documentation of <span class="title-ref">VTK</span>. I also tried to solve some of the open issues. I created a few pull requests for the same. My first contribution was in the fury <span class="title-ref">primitive</span> class, I created a sphere primitive (inspired by the sphere in Blender).</p> <p>I started looking at bugs and improvements that can be made to the source code and created PRs for the same. During this time I was also learning how computer graphics work from the <a href="https://www.youtube.com/channel/UCSynd9Z5RdIpKfvTCITV_8A/videos">UCSC lectures</a> &amp; <a href="https://youtube.com/playlist?list=PLPaoO-vpZnumdcb4tZc4x5Q-v7CkrQ6M-">OpenGL by Victor Gordon</a>.</p> <p>After the accepted organizations were announced, I was so happy that FURY got selected this year for GSoC and went straight to the Ideas list. The first project idea was <span class="title-ref">glTF Integration</span>. I heard about the <span class="title-ref">glTF</span> file format before but didn't know how it works. So I went straight through the reference materials provided on the <a href="https://github.com/fury-gl/fury/wiki/Google-Summer-of-Code-2022-(GSOC2022)">wiki</a>. I read a lot of documentation by the Khronos group. I also tried to implement a basic glTF loader during this time using VTK's built-in <span class="title-ref">glTFReader</span>.</p> <p>I also liked the Improve UI drawing project idea (I had a basic understanding of line drawing algorithms and rasterizations at that time) and thought I'll make a proposal for that too. After completing my proposal for glTF integration I started my research on this one too.</p> <p>I started writing the proposal early so that I could get my proposal reviewed at least once with the project mentors. I almost forgot the fact that I had my end-term examinations at hand (Somehow I managed to pass all of my courses), I kept contributing to the project till the end of April 2022.</p> <p>Code contributions:</p> <ol> <li>[<a href="https://github.com/fury-gl/fury/pull/520">https://github.com/fury-gl/fury/pull/520</a>]</li> <li>[<a href="https://github.com/fury-gl/fury/pull/525">https://github.com/fury-gl/fury/pull/525</a>]</li> <li>[<a href="https://github.com/fury-gl/fury/pull/533">https://github.com/fury-gl/fury/pull/533</a>]</li> <li>[<a href="https://github.com/fury-gl/fury/pull/547">https://github.com/fury-gl/fury/pull/547</a>]</li> <li>[<a href="https://github.com/fury-gl/fury/pull/556">https://github.com/fury-gl/fury/pull/556</a>]</li> <li>[<a href="https://github.com/fury-gl/fury/pull/559">https://github.com/fury-gl/fury/pull/559</a>]</li> </ol> <h2>The Day</h2> <p>May 18: I was a bit anxious since on May 18th the GSoC website was showing my proposal for glTF integration had been rejected. (p.s. maybe it was a bug of some sort that they fixed later on).</p> <p>May 20: I woke up very early in the morning and started checking the contributor's profile. I kept checking for new emails but didn't receive any emails that day. "The result will be announced at 11:30 PM, isn't it? " My dad said, It was 8:00 AM IST. I called my friends in the night to join me on discord, I was talking to them and refreshing the GSoC site at the same time. One of my friends shouted that he got selected in NumFocus. I refreshed the page again, my proposal for glTF Integration was accepted. I can't express what I felt at that moment. I told my friends and my parents, they were happy for me and I got a lot of blessings :). I received an official email the next day.</p>anandshivam54321@gmail.com (xtanion)Wed, 29 Jun 2022 14:44:55 +0000https://blogs.python-gsoc.org/en/xtanions-blog/my-journey-to-gsoc-2022-1/My Journey to GSoC 2022https://blogs.python-gsoc.org/en/xtanions-blog/my-journey-to-gsoc-2022/anandshivam54321@gmail.com (xtanion)Wed, 29 Jun 2022 14:14:31 +0000https://blogs.python-gsoc.org/en/xtanions-blog/my-journey-to-gsoc-2022/