disable all collections with python in blender 2.8Blender 2.8: how to go back to previous Collection visibility setting?2.8 Python Outliner CollectionsWhat is the Python code related to collection actions for blender 2.8?Show all Collections with one button in 2.8How to render a collection instance but not the original collection in blender 2.8?Managing layers/collections in blender 2.8Workaround for offset of linked collection? (Blender 2.8)blender 2.8 : temporarily show all visible objects in the sceneBlender 2.8 Link Collection ProblemPortal effect in EEVEE?
Get consecutive integer number ranges from list of int
Can an Area of Effect spell cast outside a Prismatic Wall extend inside it?
How do I reattach a shelf to the wall when it ripped out of the wall?
Critique of timeline aesthetic
Converting a sprinkler system's 24V AC outputs to 3.3V DC logic inputs
Phrase for the opposite of "foolproof"
A Note on N!
How to display Aura JS Errors Lightning Out
Why was the Spitfire's elliptical wing almost uncopied by other aircraft of World War 2?
What are the steps to solving this definite integral?
How does Captain America channel this power?
What happened to Captain America in Endgame?
a sore throat vs a strep throat vs strep throat
Was there a Viking Exchange as well as a Columbian one?
What happens to Mjolnir (Thor's hammer) at the end of Endgame?
can anyone help me with this awful query plan?
Can we say “you can pay when the order gets ready”?
Elements other than carbon that can form many different compounds by bonding to themselves?
Extension of 2-adic valuation to the real numbers
Why do games have consumables?
What's the name of these pliers?
What does ゆーか mean?
What is the philosophical significance of speech acts/implicature?
Apply MapThread to all but one variable
disable all collections with python in blender 2.8
Blender 2.8: how to go back to previous Collection visibility setting?2.8 Python Outliner CollectionsWhat is the Python code related to collection actions for blender 2.8?Show all Collections with one button in 2.8How to render a collection instance but not the original collection in blender 2.8?Managing layers/collections in blender 2.8Workaround for offset of linked collection? (Blender 2.8)blender 2.8 : temporarily show all visible objects in the sceneBlender 2.8 Link Collection ProblemPortal effect in EEVEE?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I am trying to disable all collections in the render with python in Blender 2.8
It works on top-level collections with the code below, but ignores nested collections.
import bpy
coll = bpy.context.view_layer.layer_collection
for x in bpy.context.view_layer.layer_collection.collection.children:
x.hide_render = True
Is there a way to get all collections, regardless of hierarchy?
collections
New contributor
$endgroup$
add a comment |
$begingroup$
I am trying to disable all collections in the render with python in Blender 2.8
It works on top-level collections with the code below, but ignores nested collections.
import bpy
coll = bpy.context.view_layer.layer_collection
for x in bpy.context.view_layer.layer_collection.collection.children:
x.hide_render = True
Is there a way to get all collections, regardless of hierarchy?
collections
New contributor
$endgroup$
$begingroup$
Welcome to Blender.se. Thank you for your question, be aware, that the 2.8 api is still under development, although I'd think, that collection access won't change anytime soon.
$endgroup$
– Leander
Apr 23 at 14:28
add a comment |
$begingroup$
I am trying to disable all collections in the render with python in Blender 2.8
It works on top-level collections with the code below, but ignores nested collections.
import bpy
coll = bpy.context.view_layer.layer_collection
for x in bpy.context.view_layer.layer_collection.collection.children:
x.hide_render = True
Is there a way to get all collections, regardless of hierarchy?
collections
New contributor
$endgroup$
I am trying to disable all collections in the render with python in Blender 2.8
It works on top-level collections with the code below, but ignores nested collections.
import bpy
coll = bpy.context.view_layer.layer_collection
for x in bpy.context.view_layer.layer_collection.collection.children:
x.hide_render = True
Is there a way to get all collections, regardless of hierarchy?
collections
collections
New contributor
New contributor
New contributor
asked Apr 23 at 13:56
cookiemonsterandthegirlscookiemonsterandthegirls
183
183
New contributor
New contributor
$begingroup$
Welcome to Blender.se. Thank you for your question, be aware, that the 2.8 api is still under development, although I'd think, that collection access won't change anytime soon.
$endgroup$
– Leander
Apr 23 at 14:28
add a comment |
$begingroup$
Welcome to Blender.se. Thank you for your question, be aware, that the 2.8 api is still under development, although I'd think, that collection access won't change anytime soon.
$endgroup$
– Leander
Apr 23 at 14:28
$begingroup$
Welcome to Blender.se. Thank you for your question, be aware, that the 2.8 api is still under development, although I'd think, that collection access won't change anytime soon.
$endgroup$
– Leander
Apr 23 at 14:28
$begingroup$
Welcome to Blender.se. Thank you for your question, be aware, that the 2.8 api is still under development, although I'd think, that collection access won't change anytime soon.
$endgroup$
– Leander
Apr 23 at 14:28
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
Access to Blender's internal data is achieved through bpy.data
. This is usually also easier to maintain, since context access (bpy.context
) is context-dependent.
Access all collections through:
bpy.data.collections
Render-restricting all collections:
import bpy
coll = bpy.data.collections
for c in coll:
c.hide_render=True
$endgroup$
1
$begingroup$
Ah! That was easy. Thanks Leander. This works:import bpy coll = bpy.data.collections for c in coll: c.hide_render=True
$endgroup$
– cookiemonsterandthegirls
Apr 23 at 14:39
1
$begingroup$
Forgot to include the final code, added your example, glad it worked. For future reference, if any answer is missing a piece of information (like your code example) feel free to suggest an edit yourself. Comments are only temporary and may get removed.
$endgroup$
– Leander
Apr 23 at 14:43
add a comment |
$begingroup$
With recursion
As well as setting attributes on all collections in bpy.data.collections
can recursively walk the children.
This will only set the property on descendants of the collection. In this case bpy.context.view_layer.layer_collection.collection
import bpy
def traverse_tree(t):
yield t
for child in t.children:
yield from traverse_tree(child)
coll = bpy.context.view_layer.layer_collection.collection
for c in traverse_tree(coll):
c.hide_render = True
$endgroup$
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "502"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
cookiemonsterandthegirls is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fblender.stackexchange.com%2fquestions%2f137860%2fdisable-all-collections-with-python-in-blender-2-8%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Access to Blender's internal data is achieved through bpy.data
. This is usually also easier to maintain, since context access (bpy.context
) is context-dependent.
Access all collections through:
bpy.data.collections
Render-restricting all collections:
import bpy
coll = bpy.data.collections
for c in coll:
c.hide_render=True
$endgroup$
1
$begingroup$
Ah! That was easy. Thanks Leander. This works:import bpy coll = bpy.data.collections for c in coll: c.hide_render=True
$endgroup$
– cookiemonsterandthegirls
Apr 23 at 14:39
1
$begingroup$
Forgot to include the final code, added your example, glad it worked. For future reference, if any answer is missing a piece of information (like your code example) feel free to suggest an edit yourself. Comments are only temporary and may get removed.
$endgroup$
– Leander
Apr 23 at 14:43
add a comment |
$begingroup$
Access to Blender's internal data is achieved through bpy.data
. This is usually also easier to maintain, since context access (bpy.context
) is context-dependent.
Access all collections through:
bpy.data.collections
Render-restricting all collections:
import bpy
coll = bpy.data.collections
for c in coll:
c.hide_render=True
$endgroup$
1
$begingroup$
Ah! That was easy. Thanks Leander. This works:import bpy coll = bpy.data.collections for c in coll: c.hide_render=True
$endgroup$
– cookiemonsterandthegirls
Apr 23 at 14:39
1
$begingroup$
Forgot to include the final code, added your example, glad it worked. For future reference, if any answer is missing a piece of information (like your code example) feel free to suggest an edit yourself. Comments are only temporary and may get removed.
$endgroup$
– Leander
Apr 23 at 14:43
add a comment |
$begingroup$
Access to Blender's internal data is achieved through bpy.data
. This is usually also easier to maintain, since context access (bpy.context
) is context-dependent.
Access all collections through:
bpy.data.collections
Render-restricting all collections:
import bpy
coll = bpy.data.collections
for c in coll:
c.hide_render=True
$endgroup$
Access to Blender's internal data is achieved through bpy.data
. This is usually also easier to maintain, since context access (bpy.context
) is context-dependent.
Access all collections through:
bpy.data.collections
Render-restricting all collections:
import bpy
coll = bpy.data.collections
for c in coll:
c.hide_render=True
edited Apr 23 at 14:42
answered Apr 23 at 14:27
LeanderLeander
13.4k11654
13.4k11654
1
$begingroup$
Ah! That was easy. Thanks Leander. This works:import bpy coll = bpy.data.collections for c in coll: c.hide_render=True
$endgroup$
– cookiemonsterandthegirls
Apr 23 at 14:39
1
$begingroup$
Forgot to include the final code, added your example, glad it worked. For future reference, if any answer is missing a piece of information (like your code example) feel free to suggest an edit yourself. Comments are only temporary and may get removed.
$endgroup$
– Leander
Apr 23 at 14:43
add a comment |
1
$begingroup$
Ah! That was easy. Thanks Leander. This works:import bpy coll = bpy.data.collections for c in coll: c.hide_render=True
$endgroup$
– cookiemonsterandthegirls
Apr 23 at 14:39
1
$begingroup$
Forgot to include the final code, added your example, glad it worked. For future reference, if any answer is missing a piece of information (like your code example) feel free to suggest an edit yourself. Comments are only temporary and may get removed.
$endgroup$
– Leander
Apr 23 at 14:43
1
1
$begingroup$
Ah! That was easy. Thanks Leander. This works:
import bpy coll = bpy.data.collections for c in coll: c.hide_render=True
$endgroup$
– cookiemonsterandthegirls
Apr 23 at 14:39
$begingroup$
Ah! That was easy. Thanks Leander. This works:
import bpy coll = bpy.data.collections for c in coll: c.hide_render=True
$endgroup$
– cookiemonsterandthegirls
Apr 23 at 14:39
1
1
$begingroup$
Forgot to include the final code, added your example, glad it worked. For future reference, if any answer is missing a piece of information (like your code example) feel free to suggest an edit yourself. Comments are only temporary and may get removed.
$endgroup$
– Leander
Apr 23 at 14:43
$begingroup$
Forgot to include the final code, added your example, glad it worked. For future reference, if any answer is missing a piece of information (like your code example) feel free to suggest an edit yourself. Comments are only temporary and may get removed.
$endgroup$
– Leander
Apr 23 at 14:43
add a comment |
$begingroup$
With recursion
As well as setting attributes on all collections in bpy.data.collections
can recursively walk the children.
This will only set the property on descendants of the collection. In this case bpy.context.view_layer.layer_collection.collection
import bpy
def traverse_tree(t):
yield t
for child in t.children:
yield from traverse_tree(child)
coll = bpy.context.view_layer.layer_collection.collection
for c in traverse_tree(coll):
c.hide_render = True
$endgroup$
add a comment |
$begingroup$
With recursion
As well as setting attributes on all collections in bpy.data.collections
can recursively walk the children.
This will only set the property on descendants of the collection. In this case bpy.context.view_layer.layer_collection.collection
import bpy
def traverse_tree(t):
yield t
for child in t.children:
yield from traverse_tree(child)
coll = bpy.context.view_layer.layer_collection.collection
for c in traverse_tree(coll):
c.hide_render = True
$endgroup$
add a comment |
$begingroup$
With recursion
As well as setting attributes on all collections in bpy.data.collections
can recursively walk the children.
This will only set the property on descendants of the collection. In this case bpy.context.view_layer.layer_collection.collection
import bpy
def traverse_tree(t):
yield t
for child in t.children:
yield from traverse_tree(child)
coll = bpy.context.view_layer.layer_collection.collection
for c in traverse_tree(coll):
c.hide_render = True
$endgroup$
With recursion
As well as setting attributes on all collections in bpy.data.collections
can recursively walk the children.
This will only set the property on descendants of the collection. In this case bpy.context.view_layer.layer_collection.collection
import bpy
def traverse_tree(t):
yield t
for child in t.children:
yield from traverse_tree(child)
coll = bpy.context.view_layer.layer_collection.collection
for c in traverse_tree(coll):
c.hide_render = True
answered Apr 23 at 14:45
batFINGERbatFINGER
27.1k53078
27.1k53078
add a comment |
add a comment |
cookiemonsterandthegirls is a new contributor. Be nice, and check out our Code of Conduct.
cookiemonsterandthegirls is a new contributor. Be nice, and check out our Code of Conduct.
cookiemonsterandthegirls is a new contributor. Be nice, and check out our Code of Conduct.
cookiemonsterandthegirls is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Blender Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fblender.stackexchange.com%2fquestions%2f137860%2fdisable-all-collections-with-python-in-blender-2-8%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Welcome to Blender.se. Thank you for your question, be aware, that the 2.8 api is still under development, although I'd think, that collection access won't change anytime soon.
$endgroup$
– Leander
Apr 23 at 14:28