Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VTK Examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VTK
VTK Examples
Merge requests
!356
Convert c++ examples to pythonic api 01
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Convert c++ examples to pythonic api 01
Convert-C++-examples-to-PythonicAPI-01
into
master
Overview
0
Commits
6
Pipelines
2
Changes
4
Merged
Andrew Maclean
requested to merge
Convert-C++-examples-to-PythonicAPI-01
into
master
8 months ago
Overview
0
Commits
6
Pipelines
2
Changes
4
Expand
0
0
Merge request reports
Viewing commit
9b55aa53
Prev
Next
Show latest version
4 files
+
121
−
17
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
9b55aa53
Adding AffineWidget
· 9b55aa53
Andrew Maclean
authored
8 months ago
src/PythonicAPI/PolyData/CombineImportedActors.py
+
3
−
17
Options
@@ -31,23 +31,22 @@ from vtkmodules.vtkRenderingCore import (
def
get_program_parameters
():
import
argparse
description
=
'
Importing a 3ds file
.
'
description
=
'
Combining imported actors
.
'
epilogue
=
'''
'''
parser
=
argparse
.
ArgumentParser
(
description
=
description
,
epilog
=
epilogue
,
formatter_class
=
argparse
.
RawDescriptionHelpFormatter
)
parser
.
add_argument
(
'
in_fn
'
,
help
=
'
iflamingo.3ds.
'
)
parser
.
add_argument
(
'
-o
'
,
'
--out_fn
'
,
default
=
None
,
help
=
'
Output file name e.g. iflamingo.obj
'
)
# Optional additional input file and folder for the OBJ reader.
parser
.
add_argument
(
'
-m
'
,
'
--mtl_fn
'
,
default
=
None
,
help
=
'
Optional OBJ MTL file name e.g. iflamingo.obj
'
)
parser
.
add_argument
(
'
-t
'
,
'
--texture_dir
'
,
default
=
None
,
help
=
'
Optional OBJ texture folder.
'
)
args
=
parser
.
parse_args
()
return
args
.
in_fn
,
args
.
out_fn
,
args
.
mtl_fn
,
args
.
texture_dir
return
args
.
in_fn
,
args
.
mtl_fn
,
args
.
texture_dir
def
main
():
ifn
,
ofn
,
mtl_fn
,
texture_dir
=
get_program_parameters
()
ifn
,
mtl_fn
,
texture_dir
=
get_program_parameters
()
input_suffixes
=
(
'
.3ds
'
,
'
.glb
'
,
'
.gltf
'
,
'
.obj
'
,
'
.wrl
'
)
output_suffixes
=
(
'
.glb
'
,
'
.gltf
'
,
'
.obj
'
,
'
.wrl
'
,
'
.x3d
'
)
@@ -65,19 +64,6 @@ def main():
print
(
f
'
Available input file suffixes are:
{
sorted_suffixes
(
input_suffixes
)
}
'
)
return
ofp
=
None
if
ofn
:
ofp
=
Path
(
ofn
)
if
not
ofp
.
suffix
.
lower
()
in
output_suffixes
:
print
(
f
'
Available output file suffixes are:
{
sorted_suffixes
(
output_suffixes
)
}
'
)
return
if
ofp
.
is_file
():
print
(
f
'
Destination must not exist:
{
ofp
}
'
)
return
if
ofp
.
suffix
.
lower
()
==
'
.obj
'
:
# We may need to create the parent folder.
ofp
.
parent
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
mtlp
=
None
if
mtl_fn
:
mtlp
=
Path
(
mtl_fn
)
Loading