Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons-contrib
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-contrib
Commits
8fcd2e98
Commit
8fcd2e98
authored
5 years ago
by
Pablo Vazquez
Browse files
Options
Downloads
Patches
Plain Diff
Amaranth: Fix "Current Blend's Folder" button missing in file browser.
parent
69bcc72f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
amaranth/__init__.py
+2
-2
2 additions, 2 deletions
amaranth/__init__.py
amaranth/scene/current_blend.py
+40
-11
40 additions, 11 deletions
amaranth/scene/current_blend.py
with
42 additions
and
13 deletions
amaranth/__init__.py
+
2
−
2
View file @
8fcd2e98
...
...
@@ -87,8 +87,8 @@ from amaranth.misc import (
bl_info
=
{
"
name
"
:
"
Amaranth Toolset
"
,
"
author
"
:
"
Pablo Vazquez, Bassam Kurdali, Sergey Sharybin, Lukas Tönne, Cesar Saez, CansecoGPC
"
,
"
version
"
:
(
1
,
0
,
7
),
"
blender
"
:
(
2
,
8
0
,
0
),
"
version
"
:
(
1
,
0
,
8
),
"
blender
"
:
(
2
,
8
1
,
0
),
"
location
"
:
"
Everywhere!
"
,
"
description
"
:
"
A collection of tools and settings to improve productivity
"
,
"
warning
"
:
""
,
...
...
This diff is collapsed.
Click to expand it.
amaranth/scene/current_blend.py
+
40
−
11
View file @
8fcd2e98
...
...
@@ -21,6 +21,12 @@ shows up if the file is saved.
import
bpy
# From space_filebrowser.py
def
panel_poll_is_upper_region
(
region
):
# The upper region is left-aligned, the lower is split into it then.
# Note that after "Flip Regions" it's right-aligned.
return
region
.
alignment
in
{
'
LEFT
'
,
'
RIGHT
'
}
class
AMTH_FILE_OT_directory_current_blend
(
bpy
.
types
.
Operator
):
...
...
@@ -33,19 +39,42 @@ class AMTH_FILE_OT_directory_current_blend(bpy.types.Operator):
return
{
"
FINISHED
"
}
def
button_directory_current_blend
(
self
,
context
):
if
bpy
.
data
.
filepath
:
self
.
layout
.
operator
(
AMTH_FILE_OT_directory_current_blend
.
bl_idname
,
text
=
"
Current Blend
'
s Folder
"
,
icon
=
"
APPEND_BLEND
"
)
class
FILEBROWSER_PT_amaranth
(
bpy
.
types
.
Panel
):
bl_space_type
=
'
FILE_BROWSER
'
bl_region_type
=
'
TOOLS
'
bl_category
=
"
Bookmarks
"
bl_label
=
"
Amaranth
"
bl_options
=
{
'
HIDE_HEADER
'
}
@classmethod
def
poll
(
cls
,
context
):
return
panel_poll_is_upper_region
(
context
.
region
)
def
register
():
bpy
.
utils
.
register_class
(
AMTH_FILE_OT_directory_current_blend
)
bpy
.
types
.
FILEBROWSER_HT_header
.
append
(
button_directory_current_blend
)
def
draw
(
self
,
context
):
layout
=
self
.
layout
layout
.
scale_x
=
1.3
layout
.
scale_y
=
1.3
if
bpy
.
data
.
filepath
:
row
=
layout
.
row
()
flow
=
row
.
grid_flow
(
row_major
=
False
,
columns
=
0
,
even_columns
=
False
,
even_rows
=
False
,
align
=
True
)
subrow
=
flow
.
row
()
subsubrow
=
subrow
.
row
(
align
=
True
)
subsubrow
.
operator
(
AMTH_FILE_OT_directory_current_blend
.
bl_idname
,
icon
=
"
DESKTOP
"
)
classes
=
(
AMTH_FILE_OT_directory_current_blend
,
FILEBROWSER_PT_amaranth
)
def
register
():
for
cls
in
classes
:
bpy
.
utils
.
register_class
(
cls
)
def
unregister
():
bpy
.
utils
.
unregister_class
(
AMTH_FILE_OT_directory_current_blend
)
bpy
.
types
.
FILEBROWSER_HT_header
.
remove
(
button_directory_current_blend
)
for
cls
in
classes
:
bpy
.
utils
.
unregister_class
(
cls
)
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