Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
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
blender
blender-addons
Commits
83f84dfd
Commit
83f84dfd
authored
13 years ago
by
Dany Lebel
Browse files
Options
Downloads
Patches
Plain Diff
Solved error message with presets menu when no path specified
parent
1ec5762e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
paint_palette.py
+16
-16
16 additions, 16 deletions
paint_palette.py
with
16 additions
and
16 deletions
paint_palette.py
+
16
−
16
View file @
83f84dfd
...
@@ -95,31 +95,31 @@ class PALETTE_MT_menu(bpy.types.Menu):
...
@@ -95,31 +95,31 @@ class PALETTE_MT_menu(bpy.types.Menu):
import
bpy.utils
import
bpy.utils
layout
=
self
.
layout
layout
=
self
.
layout
if
not
searchpaths
[
0
]:
if
not
searchpaths
:
layout
.
label
(
"
* Missing Paths *
"
)
layout
.
label
(
"
* Missing Paths *
"
)
# collect paths
# collect paths
files
=
[]
else
:
for
directory
in
searchpaths
:
files
=
[]
files
.
extend
([(
f
,
os
.
path
.
join
(
directory
,
f
))
for
f
in
os
.
listdir
(
directory
)])
for
directory
in
searchpaths
:
files
.
extend
([(
f
,
os
.
path
.
join
(
directory
,
f
))
for
f
in
os
.
listdir
(
directory
)])
files
.
sort
()
files
.
sort
()
for
f
,
filepath
in
files
:
for
f
,
filepath
in
files
:
if
f
.
startswith
(
"
.
"
):
if
f
.
startswith
(
"
.
"
):
continue
continue
preset_name
=
bpy
.
path
.
display_name
(
f
)
preset_name
=
bpy
.
path
.
display_name
(
f
)
props
=
layout
.
operator
(
operator
,
text
=
preset_name
)
props
=
layout
.
operator
(
operator
,
text
=
preset_name
)
for
attr
,
value
in
props_default
.
items
():
for
attr
,
value
in
props_default
.
items
():
setattr
(
props
,
attr
,
value
)
setattr
(
props
,
attr
,
value
)
props
.
filepath
=
filepath
props
.
filepath
=
filepath
if
operator
==
"
palette.load_gimp_palette
"
:
if
operator
==
"
palette.load_gimp_palette
"
:
props
.
menu_idname
=
self
.
bl_idname
props
.
menu_idname
=
self
.
bl_idname
def
draw_preset
(
self
,
context
):
def
draw_preset
(
self
,
context
):
"""
Define these on the subclass
"""
Define these on the subclass
...
...
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