Dev:JA/Ref/Release Notes/3.50/Python API

提供: wiki
< Dev:JA‎ | Ref/Release Notes‎ | 3.50
2023年3月18日 (土) 05:04時点におけるYamyam (トーク | 投稿記録)による版 (ページの作成:「■2023/03/18(土) 3:51 元記事:[https://wiki.blender.org/wiki/Reference/Release_Notes/3.5/Python_API Reference/Release Notes/3.5/Python API - Blender Developer…」)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先: 案内検索

■2023/03/18(土) 3:51

元記事:Reference/Release Notes/3.5/Python API - Blender Developer Wiki

Python API とテキストエディター

統合

  • ユーザーの site-packages が、--python-use-system-env を使用しなくても利用可能に。(72c012ab4a3d2a7)

全般

  • アセットブラウザーのアクティブカタログを bpy.types.FileAssetSelectParams.catalog_id で変更可能に。もう読み込みのみではありません。(rB80249ce6e4f9)
  • カスタムノードツリーのデフォルト名を NodeTree.bl_label に設定できるように。(59ce7bf)

モディファイアー

  • 新しい ModifierData.execution_time プロパティ。プロファイリングと最適化に使用できます。UI にはまだ公開していません。(8adebaeb7c3c663)
  • 新しい object.modifiers.move() メソッド。オペレーターを使用せずモディファイアーを並べ替えできます。(rBf7dd7d545472)

内部メッシュフォーマット

メッシュデータの構造のリファクタリングが、以前のリリースから3.5まで続けられていました。3.4リリースノートに同様のセクションがあります。

Internal_Mesh_Format

The mesh data structure refactoring from earlier releases has continued in 3.5. See the similar section in the 3.4 release notes.

  • The active and default (for render) color attributes are now stored as strings, making it easier to change them and access the correct attributes (rB6514bb05ea5a).
  • Mesh vertex positions are now accessible via the builtin position attribute (rB1af62cb3bf46).
  • UV layers are now stored as generic 2D vector attributes on the face corner domain (rB6c774feba2c9)
  • The sharp edge property is now stored as a generic attribute, accessible with the sharp_edge name (rBdd9e1eded0d4).
  • Loose edge status is stored separately internally (rB1ea169d90e39).
    • The MeshEdge.is_loose property is no longer editable.
    • Loose edge status can be recalculated with Mesh.update(calc_edges_loose=True)
  • Data access is generally faster than before when accessed with the attribute API (i.e. `mesh.attributes["sharp_edge"]), but slightly slower than before when accessed with the old properties.

Breaking changes

Grease Pencil Auto-masking moved to Global setting.

(4c182aef7ce0)

Props Removed:

brush.gpencil_settings.use_automasking_strokes, brush.gpencil_settings.use_automasking_layer, brush.gpencil_settings.use_automasking_material

Replaced by:

tool_settings.gpencil_sculpt.use_automasking_stroke, tool_settings.gpencil_sculpt.use_automasking_layer_stroke, tool_settings.gpencil_sculpt.use_automasking_material_stroke, tool_settings.gpencil_sculpt.use_automasking_layer_active, tool_settings.gpencil_sculpt.use_automasking_material_active

Motion tracking optical center

The internal storage of the optical center (principal point) has been changed in 7dea18b3aa to a normalized space.

The normalized space refers to coordinate (0, 0) corresponding to the frame center, (-1, -1) the left bottom frame corner, (1, 1) is the top right frame corner. This notation is available via clip.tracking.camera.principal_point property.

For some algorithms it is convenient to operate in the pixel space. For those usecases the new clip.tracking.camera.principal_point_pixels property has been added.

The old clip.tracking.camera.principal has been removed to avoid ambiguous naming in the API.

Inverted the meaning of the armature modifier vertex group in some cases

Fixed an old bug where the effect of the Invert Vertex Group toggle of the Armature modifier was inverted when Multi-Modifier was active. (rBea1c31a24438)

Scripts creating complex armature modifier setups need updating to check the exact blender version:

modifier.use_multi_modifier = True
if bpy.app.version_file < (3, 5, 8):  # Blender bug T103074
    modifier.invert_vertex_group = True

bpy.ops.object.datalayout_transfer operator

Since we now feature two domains since eae36be372a6, the single "VCOL" in the enum has been split into "COLOR_VERTEX" and "COLOR_CORNER" (93d84e87b26c).

Class Registration

  • Registering classes with the names matching existing built-in types now raises an error (52f521dec4491fe).

Node Group Input Output Creation with virtual sockets

Virtual sockets are the extra sockets added to group input and output nodes. Previously connecting a link to them would create an input or output in the corresponding node group. That feature was meant as a UI/UX feature though, and is now implemented differently in Blender and doesn't happen automatically. The correct way to add a group input from Python is to use node_tree.inputs.new(...) (70260960994d).

BGL Deprecation

BGL is a direct wrapper around OpenGL calls. The BGL module is deprecated for and since Blender 3.4 has been replaced with the 'gpu' module. From this release it will not work when using the Metal backend. Add-ons and scripts that uses the bgl module are warned about the deprecation and should use the gpu module in stead.

Bundled Libraries

Python bindings for the following libraries are now bundled with Blender, and available to use by add-ons.