Comments (7)
I've implemented a workaround in my fork, which is ok for me but totally overkill in objective terms.
Basically, I first export to DAE using the built-in bpy DAE exporter, then using your exporter and then splice both xml together... I won't loose any sleep over it, but I might try to do something more efficient later in the week.
https://github.com/mittpat/DAEBlend/commit/305c1e5c8d9739255cb9a5311a7eed16db6e0a58
from daeblend.
A hard normal edge requires duplicating the position with a separate normal. In blender there is the auto smooth modifier which breaks edges based on a critical angle. I don't know if there is anything like 3ds max smoothing groups in blender. The exporter works with the vertex data it's given instead of generating geometry. I'll investigate when I get a chance later tonight if it's a configuration issue or see what's going on.
from daeblend.
Here's a test file with two cubes:
Here's the exported DAE file rendered with FBX review
The cubes appear with correct lighting from the DAE file.
To get a flat lighting the edges need to be split with the "split modifier" or "split edge" command. Here is a cube corner with a single smoothing normal:
And here's the cube corner showing flat shading normals from splitting edges:
So it depends what you mean by a flat shaded cube. Using the "Shading: Smooth" button will have no effect on the export if all that button does in modify Blender's pixel shader without making changes to the geometry.
Regards,
Greg.
from daeblend.
Hi, thanks for the reply.
Yes custom split normals appear to work properly with DAEBlend,
However, using Blender 2.79 on Ubuntu, creating two cubes and smoothing one with the uvshading buttons with this visual result:
Once exported with the builtin exporter:
two_cubes-builtin.dae
Once exported with DAEBlend:
two_cubes-DAEblend.dae
As you can see, all the DAEBlend normals, for both cubes are at 45 degrees (-0.5773 -0.5773 -0.5773)
While the builtin exporter (OpenCollada) has the smooth cube normals at (-0.5773 -0.5773 -0.5773) but the hard cube normals at (1 0 0).
blend file:
two_cubes.blend
Thanks for putting your exporter on the web, it'a great help with Collada 1.5.0,
Pat
from daeblend.
Also, this post on the web may give a hint:
https://blender.stackexchange.com/questions/71356/vertex-normals-different-from-loop-normals
Quote:
data.calc_tessface();
for f in data.tessfaces: # indices
polygon = data.polygons[f.index] #Load Polygon
for vert in range(len(f.vertices)):
norm = data.vertices[f.vertices[vert]].normal
norm1 = data.loops[polygon.vertices[vert]].normal
print(norm, norm1)
<Vector (-0.5773, 0.5773, -0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (-0.5773, -0.5773, -0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
<Vector (-0.5773, -0.5773, 0.5773)> <Vector (-1.0000, 0.0000, 0.0000)>
...
from daeblend.
The autosmooth option wasn't working so I fixed that. For a cube mesh, turn on the autosmooth checkbox under data tab and set angle < 90 degrees. That will now export sharp edges based on the angle limit. This exporter doesn't use the 'calc_normals()' api call, that will have to be done manually using the menu 'normals->recalculate outside/inside'.
from daeblend.
It is now working as you describe.
Thanks!
from daeblend.
Related Issues (12)
- Multiple objects with the same name in Blender HOT 1
- Morph animations not exporting correctly
- Doesn't work since Blender 2.80 HOT 1
- bones are renamed HOT 2
- Active Layers option not working
- Metric units always
- Export clips as strips, first frame corrupt on end-to-end actions HOT 1
- Exported DAE with a very basic skeletal animation is completely broken, but works fine in 'Better Collada' exporter HOT 2
- Troubles with Three.js importing (r90) HOT 5
- cannot freeze wrapped/owned data HOT 1
- Remove error messages if there are no corresponding bones HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daeblend.