Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gepetto-viewer-corba
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
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
Gepetto
gepetto-viewer-corba
Commits
ae8aedd4
Commit
ae8aedd4
authored
8 years ago
by
Joseph Mirabel
Committed by
Joseph Mirabel
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update blender plugin
parent
3e2965f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
blender/gepettoimport.py
+16
-8
16 additions, 8 deletions
blender/gepettoimport.py
with
16 additions
and
8 deletions
blender/gepettoimport.py
+
16
−
8
View file @
ae8aedd4
...
...
@@ -38,7 +38,7 @@ bl_info = {
import
bpy
import
bpy_extras.io_utils
import
re
import
yaml
import
yaml
,
os
def
loadmotion
(
filename
):
with
open
(
filename
)
as
file
:
...
...
@@ -76,12 +76,16 @@ def checkframe (filename, frameId):
class
YamlPathImport
(
bpy
.
types
.
Operator
,
bpy_extras
.
io_utils
.
ImportHelper
):
bl_idname
=
"
import.gepettoimport
"
bl_label
=
"
Import a YAML Gepetto Viewer path file
"
filepath
=
bpy
.
props
.
StringProperty
(
subtype
=
"
FILE_PATH
"
)
files
=
bpy
.
props
.
CollectionProperty
(
name
=
"
File Path
"
,
type
=
bpy
.
types
.
OperatorFileListElement
,)
directory
=
bpy
.
props
.
StringProperty
(
subtype
=
'
DIR_PATH
'
,)
def
execute
(
self
,
context
):
self
.
report
({
'
INFO
'
},
"
Loading
"
+
str
(
self
.
filepath
))
loadmotion
(
self
.
filepath
)
dir
=
self
.
directory
for
f
in
self
.
files
:
fullname
=
os
.
path
.
join
(
dir
,
f
.
name
)
self
.
report
({
'
INFO
'
},
"
Loading
"
+
str
(
fullname
))
loadmotion
(
fullname
)
return
{
'
FINISHED
'
}
def
invoke
(
self
,
context
,
event
):
...
...
@@ -92,11 +96,15 @@ class UrdfToBlendImport (bpy.types.Operator, bpy_extras.io_utils.ImportHelper):
bl_idname
=
"
import.urdf_to_blendimport
"
bl_label
=
"
Import a URDF blender script
"
filepath
=
bpy
.
props
.
StringProperty
(
subtype
=
"
FILE_PATH
"
)
files
=
bpy
.
props
.
CollectionProperty
(
name
=
"
File Path
"
,
type
=
bpy
.
types
.
OperatorFileListElement
,)
directory
=
bpy
.
props
.
StringProperty
(
subtype
=
'
DIR_PATH
'
,)
def
execute
(
self
,
context
):
self
.
report
({
'
INFO
'
},
"
Loading
"
+
str
(
self
.
filepath
))
exec
(
open
(
self
.
filepath
).
read
())
dir
=
self
.
directory
for
f
in
self
.
files
:
fullname
=
os
.
path
.
join
(
dir
,
f
.
name
)
self
.
report
({
'
INFO
'
},
"
Loading
"
+
str
(
fullname
))
exec
(
open
(
fullname
).
read
())
return
{
'
FINISHED
'
}
def
invoke
(
self
,
context
,
event
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment