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
f77e8943
Commit
f77e8943
authored
13 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
remove redundant newline escaping
parent
f4cc74ec
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
render_copy_settings/__init__.py
+13
-45
13 additions, 45 deletions
render_copy_settings/__init__.py
render_copy_settings/operator.py
+5
-5
5 additions, 5 deletions
render_copy_settings/operator.py
render_copy_settings/panel.py
+1
-1
1 addition, 1 deletion
render_copy_settings/panel.py
with
19 additions
and
51 deletions
render_copy_settings/__init__.py
+
13
−
45
View file @
f77e8943
...
@@ -18,41 +18,6 @@
...
@@ -18,41 +18,6 @@
# <pep8 compliant>
# <pep8 compliant>
# ##### CHANGELOG #####
#
# 0.0.1
# Initial release.
#
# 0.0.2
# Updates to follow Blender API:
# * bl_addon_info renamed in bl_info!
# * adding bpy.utils.(un)register_module calls.
# Also, in standard import, using “from . import …” now.
#
# 0.1.0
# Renamed in “Render Copy Settings”.
# Huge changes:
# * It is now possible to individually copy each render setting.
# * It is now possible to individually select each affected scene, and
# then filter them out even further with a regex.
#
# 0.1.1
# Minor changes:
# * PEP8 compliant.
# * Moved to contrib…
#
# 0.1.2
# Minor changes:
# * Updated accordingly to the changes in enhanced ui_template_list
# proposal.
#
# 0.1.3
# Minor changes:
# * Fixed a small bug that was disabling the whole UI when entering a
# filtering regex matching no scene.
#
# ##### END OF CHANGELOG #####
bl_info
=
{
bl_info
=
{
"
name
"
:
"
Copy Settings
"
,
"
name
"
:
"
Copy Settings
"
,
"
author
"
:
"
Bastien Montagne
"
,
"
author
"
:
"
Bastien Montagne
"
,
...
@@ -60,11 +25,11 @@ bl_info = {
...
@@ -60,11 +25,11 @@ bl_info = {
"
blender
"
:
(
2
,
6
,
1
),
"
blender
"
:
(
2
,
6
,
1
),
"
api
"
:
42648
,
"
api
"
:
42648
,
"
location
"
:
"
Render buttons (Properties window)
"
,
"
location
"
:
"
Render buttons (Properties window)
"
,
"
description
"
:
"
Allows to copy a selection of render settings from
"
\
"
description
"
:
"
Allows to copy a selection of render settings from
"
"
current scene to others.
"
,
"
current scene to others.
"
,
"
wiki_url
"
:
"
http://wiki.blender.org/index.php/Extensions:2.5/Py/
"
\
"
wiki_url
"
:
"
http://wiki.blender.org/index.php/Extensions:2.5/Py/
"
"
Scripts/Render/Copy Settings
"
,
"
Scripts/Render/Copy Settings
"
,
"
tracker_url
"
:
"
http://projects.blender.org/tracker/index.php?
"
\
"
tracker_url
"
:
"
http://projects.blender.org/tracker/index.php?
"
"
func=detail&aid=25832
"
,
"
func=detail&aid=25832
"
,
"
category
"
:
"
Render
"
}
"
category
"
:
"
Render
"
}
...
@@ -79,8 +44,11 @@ else:
...
@@ -79,8 +44,11 @@ else:
import
bpy
import
bpy
from
bpy.props
import
StringProperty
,
BoolProperty
,
\
from
bpy.props
import
(
StringProperty
,
IntProperty
,
CollectionProperty
BoolProperty
,
IntProperty
,
CollectionProperty
,
PointerProperty
)
###############################################################################
###############################################################################
...
@@ -112,8 +80,8 @@ class RenderCopySettings(bpy.types.PropertyGroup):
...
@@ -112,8 +80,8 @@ class RenderCopySettings(bpy.types.PropertyGroup):
# It should only contain one element for each render setting.
# It should only contain one element for each render setting.
affected_settings
=
CollectionProperty
(
type
=
RenderCopySettingsSetting
,
affected_settings
=
CollectionProperty
(
type
=
RenderCopySettingsSetting
,
name
=
"
Affected Settings
"
,
name
=
"
Affected Settings
"
,
description
=
"
The list of all
"
\
description
=
"
The list of all
"
"
available render
"
\
"
available render
"
"
settings
"
)
"
settings
"
)
# XXX Unused, but needed for template_list…
# XXX Unused, but needed for template_list…
aff_sett_idx
=
IntProperty
()
aff_sett_idx
=
IntProperty
()
...
@@ -122,13 +90,13 @@ class RenderCopySettings(bpy.types.PropertyGroup):
...
@@ -122,13 +90,13 @@ class RenderCopySettings(bpy.types.PropertyGroup):
# It should only contain one element for each scene.
# It should only contain one element for each scene.
allowed_scenes
=
CollectionProperty
(
type
=
RenderCopySettingsScene
,
allowed_scenes
=
CollectionProperty
(
type
=
RenderCopySettingsScene
,
name
=
"
Allowed Scenes
"
,
name
=
"
Allowed Scenes
"
,
description
=
"
The list all scenes
"
\
description
=
"
The list all scenes
"
"
in the file
"
)
"
in the file
"
)
# XXX Unused, but needed for template_list…
# XXX Unused, but needed for template_list…
allw_scenes_idx
=
IntProperty
()
allw_scenes_idx
=
IntProperty
()
filter_scene
=
StringProperty
(
name
=
"
Filter Scene
"
,
filter_scene
=
StringProperty
(
name
=
"
Filter Scene
"
,
description
=
"
Regex to only affect scenes
"
\
description
=
"
Regex to only affect scenes
"
"
which name matches it
"
,
"
which name matches it
"
,
default
=
""
)
default
=
""
)
...
@@ -139,7 +107,7 @@ def register():
...
@@ -139,7 +107,7 @@ def register():
bpy
.
utils
.
register_class
(
RenderCopySettingsSetting
)
bpy
.
utils
.
register_class
(
RenderCopySettingsSetting
)
bpy
.
utils
.
register_class
(
RenderCopySettings
)
bpy
.
utils
.
register_class
(
RenderCopySettings
)
bpy
.
types
.
Scene
.
render_copy_settings
=
\
bpy
.
types
.
Scene
.
render_copy_settings
=
\
bpy
.
props
.
PointerProperty
(
type
=
RenderCopySettings
)
PointerProperty
(
type
=
RenderCopySettings
)
bpy
.
utils
.
register_module
(
__name__
)
bpy
.
utils
.
register_module
(
__name__
)
...
...
This diff is collapsed.
Click to expand it.
render_copy_settings/operator.py
+
5
−
5
View file @
f77e8943
...
@@ -94,12 +94,12 @@ class RenderCopySettingsPrepare(bpy.types.Operator):
...
@@ -94,12 +94,12 @@ class RenderCopySettingsPrepare(bpy.types.Operator):
try
:
try
:
regex
=
re
.
compile
(
cp_sett
.
filter_scene
)
regex
=
re
.
compile
(
cp_sett
.
filter_scene
)
except
Exception
as
e
:
except
Exception
as
e
:
self
.
report
(
'
ERROR_INVALID_INPUT
'
,
"
The filter-scene
"
\
self
.
report
(
'
ERROR_INVALID_INPUT
'
,
"
The filter-scene
"
"
regex did not compile:
\n
(%s).
"
%
str
(
e
))
"
regex did not compile:
\n
(%s).
"
%
str
(
e
))
return
{
'
CANCELLED
'
}
return
{
'
CANCELLED
'
}
except
:
except
:
regex
=
None
regex
=
None
self
.
report
(
'
WARNING
'
,
"
Unable to import the re module.
"
\
self
.
report
(
'
WARNING
'
,
"
Unable to import the re module.
"
"
Regex scene filtering will be disabled!
"
)
"
Regex scene filtering will be disabled!
"
)
scenes
=
set
()
scenes
=
set
()
for
scene
in
bpy
.
data
.
scenes
:
for
scene
in
bpy
.
data
.
scenes
:
...
@@ -166,7 +166,7 @@ class RenderCopySettingsPreset(bpy.types.Operator):
...
@@ -166,7 +166,7 @@ class RenderCopySettingsPreset(bpy.types.Operator):
def
do_copy
(
context
,
affected_settings
,
allowed_scenes
):
def
do_copy
(
context
,
affected_settings
,
allowed_scenes
):
# Stores render settings from current scene.
# Stores render settings from current scene.
p
=
{
sett
:
getattr
(
context
.
scene
.
render
,
sett
)
\
p
=
{
sett
:
getattr
(
context
.
scene
.
render
,
sett
)
for
sett
in
affected_settings
}
for
sett
in
affected_settings
}
# put it in all other (valid) scenes’ render settings!
# put it in all other (valid) scenes’ render settings!
for
scene
in
bpy
.
data
.
scenes
:
for
scene
in
bpy
.
data
.
scenes
:
...
@@ -192,9 +192,9 @@ class RenderCopySettings(bpy.types.Operator):
...
@@ -192,9 +192,9 @@ class RenderCopySettings(bpy.types.Operator):
def
execute
(
self
,
context
):
def
execute
(
self
,
context
):
regex
=
None
regex
=
None
cp_sett
=
context
.
scene
.
render_copy_settings
cp_sett
=
context
.
scene
.
render_copy_settings
affected_settings
=
{
sett
.
strid
for
sett
in
cp_sett
.
affected_settings
\
affected_settings
=
{
sett
.
strid
for
sett
in
cp_sett
.
affected_settings
if
sett
.
copy
}
if
sett
.
copy
}
allowed_scenes
=
{
sce
.
name
for
sce
in
cp_sett
.
allowed_scenes
\
allowed_scenes
=
{
sce
.
name
for
sce
in
cp_sett
.
allowed_scenes
if
sce
.
allowed
}
if
sce
.
allowed
}
do_copy
(
context
,
affected_settings
=
affected_settings
,
do_copy
(
context
,
affected_settings
=
affected_settings
,
allowed_scenes
=
allowed_scenes
)
allowed_scenes
=
allowed_scenes
)
...
...
This diff is collapsed.
Click to expand it.
render_copy_settings/panel.py
+
1
−
1
View file @
f77e8943
...
@@ -48,7 +48,7 @@ class RENDER_PT_copy_settings(bpy.types.Panel):
...
@@ -48,7 +48,7 @@ class RENDER_PT_copy_settings(bpy.types.Panel):
prop_list
=
"
template_list_controls
"
,
rows
=
6
)
prop_list
=
"
template_list_controls
"
,
rows
=
6
)
col
=
split
.
column
()
col
=
split
.
column
()
all_set
=
{
sett
.
strid
for
sett
in
cp_sett
.
affected_settings
\
all_set
=
{
sett
.
strid
for
sett
in
cp_sett
.
affected_settings
if
sett
.
copy
}
if
sett
.
copy
}
for
p
in
presets
.
presets
:
for
p
in
presets
.
presets
:
label
=
""
label
=
""
...
...
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