Revision: 17156
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17156
Author:   campbellbarton
Date:     2008-10-22 01:14:40 +0200 (Wed, 22 Oct 2008)

Log Message:
-----------
add a way for external scripts to call X3D/VRML importer and deal with unknown 
node types.

Modified Paths:
--------------
    trunk/blender/release/scripts/import_web3d.py

Modified: trunk/blender/release/scripts/import_web3d.py
===================================================================
--- trunk/blender/release/scripts/import_web3d.py       2008-10-21 23:07:09 UTC 
(rev 17155)
+++ trunk/blender/release/scripts/import_web3d.py       2008-10-21 23:14:40 UTC 
(rev 17156)
@@ -53,7 +53,7 @@
 # order dosnt matter for loc/size/rot
 # right handed rotation
 # angles are in radians
-# rotation first defines axis then ammount in deg
+# rotation first defines axis then ammount in radians
 
 
 
@@ -1782,7 +1782,7 @@
        bpyob.setMatrix( getFinalMatrix(node, None, ancestry) )
 
 
-def load_web3d(path, PREF_FLAT=False, PREF_CIRCLE_DIV=16):
+def load_web3d(path, PREF_FLAT=False, PREF_CIRCLE_DIV=16, HELPER_FUNC = None):
        
        # Used when adding blender primitives
        GLOBALS['CIRCLE_DETAIL'] = PREF_CIRCLE_DIV
@@ -1818,8 +1818,14 @@
                elif spec=='Transform':
                        # Only use transform nodes when we are not importing a 
flat object hierarchy
                        if PREF_FLAT==False:
-                               importTransform(node, ancestry)
-       
+                               importTransform(node, ancestry)                 
+               else:
+                       
+                       # Note, include this function so the VRML/X3D importer 
can be extended
+                       # by an external script.
+                       if HELPER_FUNC:
+                               HELPER_FUNC(node, ancestry)
+                       
        # Add in hierarchy
        if PREF_FLAT==False:
                child_dict = {}


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to