Obj loading/saving brightness inconsistency #45316
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#45316
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Elementary OS Luna, Nvidia GTX 560Ti
Blender Version
Broken: 2.75
Short description of error
Loading and then resaving an obj file results in darker material ambient, diffuse and specular values.
Upon load the obj .mtl Ka and Kd values are loaded directly in as the material
mirror_color
(ambient) anddiffuse_color
.However when saved they are also multiplied by
world.ambient_color
anddiffuse_intensity
.The diffuse intensity is left at the default of 0.8, resulting in values loading and then saving as slightly darker each time, and world.ambient is (0,0,0) by default, removing any ambient color.
It seems that
diffuse_intensity
should probably be set to 1.0 on load, so the Kd value is properly honoured, and loading/saving is consistent.world.ambient_color
is trickier. It could be ignored when saving to avoid this inconsistency, but it's unclear if this is the best course of action.Lastly the specular hardness values are not honoured between load and save. There appears to be a typo loading the values. They are loaded as
specular_hardness = int(value * 0.51)
, but saved as(specular_hardness - 1) * 1.9607843137254901
. Resulting in their values decreasing slightly on save. It seems load should probably readspecular_hardness = int(value * 0.51) + 1
but the +1 was missed out by mistake.Exact steps for others to reproduce the error
Load an .obj model with ambient, diffuse material colours and/or specular hardness values
Re-save the model
All
Kd
values in the obj .mtl file will now be darker, allKa
values will be 0.0 0.0 0.0, and allNs
values will be lower.Changed status to: 'Open'
Added subscriber: @ProPuke
Added subscriber: @mont29
This issue was referenced by
3430fbc701
Changed status from 'Open' to: 'Resolved'
Thanks for finding those and your suggested fixes, all sounds reasonable, committed them. :)