diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-10-22 03:14:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-10-22 03:14:40 +0400 |
commit | 4936e09cdf37e0225e948312a23afa576f2fae35 (patch) | |
tree | ece382776576dd83d23e621202931379ecafa54c /release/scripts/import_web3d.py | |
parent | 71206c9337ec88d8711fa66c128fe464cf27e451 (diff) |
add a way for external scripts to call X3D/VRML importer and deal with unknown node types.
Diffstat (limited to 'release/scripts/import_web3d.py')
-rwxr-xr-x | release/scripts/import_web3d.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/release/scripts/import_web3d.py b/release/scripts/import_web3d.py index e934d06e9ef..9447f15fb79 100755 --- a/release/scripts/import_web3d.py +++ b/release/scripts/import_web3d.py @@ -53,7 +53,7 @@ def dirName(path): # 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 @@ def importTransform(node, ancestry): 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 @@ def load_web3d(path, PREF_FLAT=False, PREF_CIRCLE_DIV=16): 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 = {} |