snipt

Ctrl+h for KB shortcuts

Python 3

Basic static Python with error

1
2
3
4
def f() -> None:
   x = 1 + 'a'

f()
https://snipt.net/embed/d188ea8494f2fa82df7809a1feda01fb/
https://snipt.net/raw/d188ea8494f2fa82df7809a1feda01fb/
d188ea8494f2fa82df7809a1feda01fb
python3
Python 3
4
2016-08-29T15:04:24
True
False
False
Jun 13, 2016 at 10:06 PM
/api/public/snipt/147191/
basic-static-python-with-error
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">def</span> <span class="nf">f</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="k">None</span><span class="p">:</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">x</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">+</span> <span class="s">&#39;a&#39;</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="n">f</span><span class="p">()</span> </span></pre></div> </td></tr></table>
python, static

Python 3

Basic dynamic Python

1
2
3
4
def f():
   x = 1 + 'a'

f()
https://snipt.net/embed/7a1cdec5bdd78e0c498eb8bc6332f789/
https://snipt.net/raw/7a1cdec5bdd78e0c498eb8bc6332f789/
7a1cdec5bdd78e0c498eb8bc6332f789
python3
Python 3
4
2016-08-29T23:42:02
True
False
False
/api/public/snipt/147189/
basic-dynamic-python
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">def</span> <span class="nf">f</span><span class="p">():</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">x</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">+</span> <span class="s">&#39;a&#39;</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="n">f</span><span class="p">()</span> </span></pre></div> </td></tr></table>
python

Python

Blender - Hair set start end simulation

1
2
3
4
5
import bpy
scene = bpy.context.scene
obj = bpy.data.groups["Group_name"].objects["Object_name"]
obj.particle_systems["ParticleSystem"].point_cache.frame_start = scene.frame_start
obj.particle_systems["ParticleSystem"].point_cache.frame_end = scene.frame_end
https://snipt.net/embed/e87e319974b0dbac89ec5c6660c8a824/
https://snipt.net/raw/e87e319974b0dbac89ec5c6660c8a824/
e87e319974b0dbac89ec5c6660c8a824
python
Python
5
2016-08-26T00:43:40
True
False
True
Aug 06, 2015 at 02:55 PM
/api/public/snipt/140567/
blender-hair-set-start-end-simulation
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="kn">import</span> <span class="nn">bpy</span> </span><span id="L-2"><a name="L-2"></a><span class="n">scene</span> <span class="o">=</span> <span class="n">bpy</span><span class="o">.</span><span class="n">context</span><span class="o">.</span><span class="n">scene</span> </span><span id="L-3"><a name="L-3"></a><span class="n">obj</span> <span class="o">=</span> <span class="n">bpy</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">groups</span><span class="p">[</span><span class="s">&quot;Group_name&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">objects</span><span class="p">[</span><span class="s">&quot;Object_name&quot;</span><span class="p">]</span> </span><span id="L-4"><a name="L-4"></a><span class="n">obj</span><span class="o">.</span><span class="n">particle_systems</span><span class="p">[</span><span class="s">&quot;ParticleSystem&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">point_cache</span><span class="o">.</span><span class="n">frame_start</span> <span class="o">=</span> <span class="n">scene</span><span class="o">.</span><span class="n">frame_start</span> </span><span id="L-5"><a name="L-5"></a><span class="n">obj</span><span class="o">.</span><span class="n">particle_systems</span><span class="p">[</span><span class="s">&quot;ParticleSystem&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">point_cache</span><span class="o">.</span><span class="n">frame_end</span> <span class="o">=</span> <span class="n">scene</span><span class="o">.</span><span class="n">frame_end</span> </span></pre></div> </td></tr></table>
blender, python
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.