Merge branch 'master' into blender2.8
This commit is contained in:
commit
6af997710b
@ -298,4 +298,3 @@ then copied :kbd:`Control-C`, usually to paste in the text editor or python cons
|
||||
zooming the view for example isn't so useful to repeat so its excluded from the output.
|
||||
|
||||
To display *every* operator that runs see :ref:`Show All Operators <info_show_all_operators>`
|
||||
|
||||
|
@ -297,13 +297,13 @@ Here are 3 ways of joining multiple strings into one string for writing.
|
||||
This also applies to any area of your code that involves a lot of string joining.
|
||||
|
||||
|
||||
``String addition`` -
|
||||
``String addition`` -
|
||||
this is the slowest option, *don't use if you can help it, especially when writing data in a loop*.
|
||||
|
||||
>>> file.write(str1 + " " + str2 + " " + str3 + "\n")
|
||||
|
||||
|
||||
``String formatting`` -
|
||||
``String formatting`` -
|
||||
use this when you are writing string data from floats and ints.
|
||||
|
||||
>>> file.write("%s %s %s\n" % (str1, str2, str3))
|
||||
@ -392,4 +392,3 @@ While developing a script it is good to time it to be aware of any changes in pe
|
||||
# do something...
|
||||
|
||||
print("My Script Finished: %.4f sec" % (time.time() - time_start))
|
||||
|
||||
|
@ -205,8 +205,8 @@ Support Overview
|
||||
|
||||
* - Usage
|
||||
- :class:`bpy.types.MeshPolygon`
|
||||
- :class:`bpy.types.MeshTessFace`
|
||||
- :class:`bmesh.types.BMFace`
|
||||
- :class:`bpy.types.MeshTessFace`
|
||||
- :class:`bmesh.types.BMFace`
|
||||
* - Import/Create
|
||||
- Poor *(inflexible)*
|
||||
- Good *(supported as upgrade path)*
|
||||
@ -288,7 +288,7 @@ Example using :class:`bpy.types.EditBone` in armature editmode:
|
||||
|
||||
This is only possible in edit mode.
|
||||
|
||||
>>> bpy.context.object.data.edit_bones["Bone"].head = Vector((1.0, 2.0, 3.0))
|
||||
>>> bpy.context.object.data.edit_bones["Bone"].head = Vector((1.0, 2.0, 3.0))
|
||||
|
||||
This will be empty outside of editmode.
|
||||
|
||||
@ -333,7 +333,7 @@ Examples using :class:`bpy.types.PoseBone` in object or pose mode:
|
||||
.. code-block:: python
|
||||
|
||||
# Gets the name of the first constraint (if it exists)
|
||||
bpy.context.object.pose.bones["Bone"].constraints[0].name
|
||||
bpy.context.object.pose.bones["Bone"].constraints[0].name
|
||||
|
||||
# Gets the last selected pose bone (pose mode only)
|
||||
bpy.context.active_pose_bone
|
||||
@ -378,7 +378,7 @@ This can cause bugs when you add some data (normally imported) then reference it
|
||||
.. code-block:: python
|
||||
|
||||
bpy.data.meshes.new(name=meshid)
|
||||
|
||||
|
||||
# normally some code, function calls...
|
||||
bpy.data.meshes[meshid]
|
||||
|
||||
@ -388,7 +388,7 @@ Or with name assignment...
|
||||
.. code-block:: python
|
||||
|
||||
obj.name = objname
|
||||
|
||||
|
||||
# normally some code, function calls...
|
||||
obj = bpy.data.meshes[objname]
|
||||
|
||||
@ -408,12 +408,12 @@ this way you don't run this risk of referencing existing data from the blend fil
|
||||
|
||||
# typically declared in the main body of the function.
|
||||
mesh_name_mapping = {}
|
||||
|
||||
|
||||
mesh = bpy.data.meshes.new(name=meshid)
|
||||
mesh_name_mapping[meshid] = mesh
|
||||
|
||||
|
||||
# normally some code, or function calls...
|
||||
|
||||
|
||||
# use own dictionary rather than bpy.data
|
||||
mesh = mesh_name_mapping[meshid]
|
||||
|
||||
|
@ -125,7 +125,7 @@ its attributes can be accessed much like you would change a setting using the gr
|
||||
In fact, the tooltip for each button also displays the Python attribute
|
||||
which can help in finding what settings to change in a script.
|
||||
|
||||
>>> bpy.data.objects[0].name
|
||||
>>> bpy.data.objects[0].name
|
||||
'Camera'
|
||||
|
||||
>>> bpy.data.scenes["Scene"]
|
||||
@ -267,7 +267,7 @@ Operator Poll()
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Many operators have a "poll" function which may check that the cursor
|
||||
is in a valid area or that the object is in the correct mode (Edit Mode, Weight Paint etc).
|
||||
is in a valid area or that the object is in the correct mode (Edit Mode, Weight Paint etc).
|
||||
When an operator's poll function fails within Python, an exception is raised.
|
||||
|
||||
For example, calling ``bpy.ops.view3d.render_border()`` from the console raises the following error:
|
||||
@ -477,4 +477,3 @@ Using Low-Level Functions:
|
||||
fcu_z.keyframe_points.add(2)
|
||||
fcu_z.keyframe_points[0].co = 10.0, 0.0
|
||||
fcu_z.keyframe_points[1].co = 20.0, 1.0
|
||||
|
||||
|
@ -315,4 +315,3 @@ enable the CMake build option ``WITH_PYTHON_SAFETY``.
|
||||
|
||||
This enables data tracking which makes data access about 2x slower
|
||||
which is why the option isn't enabled in release builds.
|
||||
|
||||
|
@ -133,7 +133,7 @@ string NamedNestedSampleStats::full_report(int indent_level, uint64_t total_samp
|
||||
sum_seconds,
|
||||
self_percent,
|
||||
self_seconds);
|
||||
string result = indent + info;
|
||||
string result = indent + info;
|
||||
|
||||
sort(entries.begin(), entries.end(), namedTimeSampleEntryComparator);
|
||||
foreach(NamedNestedSampleStats& entry, entries) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user