Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#26220] Patch to allow lit and textured shapes for X3D exporter in SVN

Date:
2011-02-25 21:37
Priority:
3
State:
Closed
Submitted by:
Michalis Kamburelis (kambi)
Assigned to:
Campbell Barton (campbellbarton)
Category:
Import/Export
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
Patch to allow lit and textured shapes for X3D exporter in SVN
Detailed description
Current Blender X3D exporter in SVN writes either a material or a texture node, but never both. This means that your surface is either not textured, or it is unlit (X3D spec clearly says that shapes without material are unlit, i.e. rendered with GL_LIGHTING turned off).

This is quite bad IMO, as (almost?) all normal models want some textures and want to be lit. This is also a functionality lost, in comparison to Blender 2.56 X3D exporter, or old Blender 2.4x VRML 97 exporters --- they were able to generate lit models with textures, if you assigned a texture to the material (without marking material as "face texture"). New exporter in SVN doesn't differentiate between a texture activated by "face texture" and a texture activated by adding it to the material node (which is good idea IMHO), but it also makes every textured shape unlit (which is a bad for normal uses, again IMHO).

I propose the attached simple patch, to write both texture and material. This simply makes "if image" and "if material" tests independent, which I think is most useful.

Note that you can still make shapes unlit --- just delete the Blender material. Then X3D material will also not exist, and shape will be unlit in X3D.

(Note that it also always adds an <Appearance> node, which is OK -- empty <Appearance> node is equivalent to not existing.)

The patch is done and tested vs current SVN as of today, 35189. Test with any Blender textured model, and some X3D browser (I used my view3dscene).

Followup

Message
  • Date: 2011-02-26 13:48
  • Sender: Ton Roosendaal
  • Assigning to Campbell to check on! (Although it does belong in patch tracker actually)
  • Date: 2011-02-26 16:42
  • Sender: Campbell Barton
  • thanks for the fix,
    applied. r1659.
 

Attached Files:

Name Date Download
lit_and_textured.patch 2011-02-25 21:37 Download

Changes:

Field Old Value Date By
status_idOpen2011-02-26 16:42campbellbarton
close_dateNone2011-02-26 16:42campbellbarton
StatusInvestigate2011-02-26 16:42campbellbarton
assigned_tonone2011-02-26 13:48ton
StatusNew2011-02-26 13:48ton
File Added15150: lit_and_textured.patch2011-02-25 21:37kambi