Home › Forums › Bug Reports and Feature Requests › Morphing Line Rendered Objects
- This topic has 5 replies, 4 voices, and was last updated 5 days, 10 hours ago by
justin_blender.
-
AuthorPosts
-
2025-05-03 at 5:48 pm #81717
justin_blender
CustomerHello,
I know that it is not a bug, so I am asking for this as a feature request:When an object is switched to “Line Rendering”, the Morphing from Shape Keys have no effect. Wireframe rendering is not an option because it renders the triangulated Mesh.
I missed this feature in various projects already, since I do a lot of technical drawings and lines are just inevitable there.
I hope I am not the only and its not too complicated.Cheers
2025-05-03 at 6:22 pm #81721visualizer
CustomerHi
Justin,
I am also from a technical background & what you say is not wrong.
I understand the pain correctly.
One thing already exists which is really great that the dynamic cut section ability. Fortunately, it is there but if this line thing comes up then it would be great.
One wish I have is if the line can be shown increasing in length with its turns and beds would be a value addition too.2025-05-05 at 2:44 pm #81758Alexander Kovelenov
Staff2025-05-06 at 7:38 am #81765David Duperron
CustomerHi there!
I also use a lot of line rendering in my Application, and as you mention the basic line rendering straight out of Blender is often too limited.
However, with a bit of Javascript coding, it is possible to implement other “hidden” features that are included in the V3D libraries under the hood, like here, or here (the dashed lines are very useful!).2025-05-26 at 6:46 pm #82156justin_blender
CustomerThis function adds a wireframe after a shapekey.
addWireframeForMorphedCube(app.scene, "Cube3"); function addWireframeForMorphedCube(scene, cubeName) { const mesh = scene.getObjectByName(cubeName); if (!mesh) { console.warn(<code>Object named "${cubeName}" not found</code>); return; } if (!mesh.morphTargetInfluences || mesh.morphTargetInfluences.length === 0) { console.warn(<code>Object "${cubeName}" has no morph targets</code>); return; } // Clone the geometry to avoid modifying the original const baseGeometry = mesh.geometry.clone(); // Create a typed array to hold new positions after morphs const positionAttr = baseGeometry.attributes.position; const morphPositions = []; // Initialize with base geometry positions for (let i = 0; i < positionAttr.count * 3; i++) { morphPositions = positionAttr.array; } // Apply each morph target weighted by its influence const morphAttrs = baseGeometry.morphAttributes.position || []; mesh.morphTargetInfluences.forEach((influence, idx) => { if (influence === 0) return; // skip zero influence const morphAttr = morphAttrs[idx]; if (!morphAttr) return; for (let i = 0; i < morphAttr.count * 3; i++) { morphPositions += influence * morphAttr.array; } }); // Replace position attribute with morphed positions const morphedPositionArray = new Float32Array(morphPositions); baseGeometry.setAttribute('position', new v3d.BufferAttribute(morphedPositionArray, 3)); baseGeometry.computeVertexNormals(); // Create edges geometry from morphed geometry const edges = new v3d.EdgesGeometry(baseGeometry, 30); // Use 30° threshold for cleaner edges const lineMat = new v3d.LineBasicMaterial({ color: 0x000000 }); const wireframe = new v3d.LineSegments(edges, lineMat); // Match position/rotation/scale of original mesh wireframe.position.copy(mesh.position); wireframe.rotation.copy(mesh.rotation); wireframe.scale.copy(mesh.scale); wireframe.name = <code>${cubeName}_wireframe</code>; scene.add(wireframe); } }
-
AuthorPosts
- You must be logged in to reply to this topic.