﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3A2.5%2FSource%2FPython%2FMathutils</id>
	<title>Dev:2.5/Source/Python/Mathutils - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3A2.5%2FSource%2FPython%2FMathutils"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Python/Mathutils&amp;action=history"/>
	<updated>2026-06-08T03:29:49Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Python/Mathutils&amp;diff=102963&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Python/Mathutils&amp;diff=102963&amp;oldid=prev"/>
		<updated>2018-06-28T19:41:17Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 19:41時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Python/Mathutils&amp;diff=102962&amp;oldid=prev</id>
		<title>wiki&gt;Ideasman42: /* Consistent Matrix Constructor Argument order */</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.5/Source/Python/Mathutils&amp;diff=102962&amp;oldid=prev"/>
		<updated>2011-02-04T07:18:08Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Consistent Matrix Constructor Argument order&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Mathutils API Update=&lt;br /&gt;
Recently a patch was submitted [#25747], which highlights some problems with the mathutils API which I have also noticed from my use of mathutils for testing tools and import/exporters.&lt;br /&gt;
&lt;br /&gt;
I ran these changes by Uncle_Entity, dougal2 &amp;amp; z0r on IRC before writing up the proposal for initial feedback and have now written down the proposed changes in detail.&lt;br /&gt;
&lt;br /&gt;
--[[User:Ideasman42|Ideasman42]] 10:51, 3 February 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Coerce Method Arguments ==&lt;br /&gt;
At the moment passing fixed values to a function is annoying because you must use mathutils constructors, or assign a value beforehand for reuse.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; myvec.cross(Vector((0, 0, 1)))&lt;br /&gt;
&lt;br /&gt;
... but we could also accept&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; myvec.cross((0, 0, 1))&lt;br /&gt;
&lt;br /&gt;
Same with vec.angle(other), quat.difference((...))&lt;br /&gt;
&lt;br /&gt;
This will '''NOT''' extend to operators&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; Vector(...) + (1,2,3)&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; Vector(...) + Euler(...)&lt;br /&gt;
&lt;br /&gt;
Seems convenient but introduces ambiguity as to what is the return type, and confuses which operators have special behavior such as Vector() * Matrix().&lt;br /&gt;
&lt;br /&gt;
It also means the first value:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; (x, y, z, x) * Matrix()&lt;br /&gt;
&lt;br /&gt;
Could be treated as a 4d vector or a quaternion.&lt;br /&gt;
&lt;br /&gt;
== Separate Modify In-Place Methods == &lt;br /&gt;
Clear separation between methods which modify in-place and ones which return new values.&lt;br /&gt;
&lt;br /&gt;
At the moment this backfires in common cases when modifying wrapped data is not intended:&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; imat = obj.matrix_world.invert() * othermat # edits object.&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; imat = obj.matrix_world.copy().invert() * othermat # ok.&lt;br /&gt;
&lt;br /&gt;
mathutils wrapped types are used in the GameEngine and for many RNA types so I think its worth avoiding confusion here.&lt;br /&gt;
&lt;br /&gt;
I propose to have 2 methods in cases such as this.&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; matrix.invert()  # Inverts in-place, returns None&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; matrix.inverted()  # Returns a new, inverted matrix.&lt;br /&gt;
&lt;br /&gt;
Same with normalize / normalized, transpose / transposed... etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rename Methods ==&lt;br /&gt;
&lt;br /&gt;
* matrix/euler.to_quat() --&amp;gt; to_quaternion()&amp;lt;br&amp;gt;''This abbreviation isnt used anywhere else in mathutils.''&lt;br /&gt;
* matrix.rotation_part() --&amp;gt; matrix.to_3x3()&amp;lt;br&amp;gt;''rotation_part() also contains scale which is misleading.''&lt;br /&gt;
* matrix.translation_part() --&amp;gt; to_translation()&lt;br /&gt;
* scale_part() --&amp;gt; to_scale()&amp;lt;br&amp;gt;''At the moment we have matrix methods rotation_part() / scale_part() / translation_part().&amp;lt;br&amp;gt;The method naming implies that together they will decompose the matrix, but as noted above this is not the case.&amp;lt;br&amp;gt;Since these methods were written I have added...''&lt;br /&gt;
&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; loc, rot, scale = matrix.decompose()&lt;br /&gt;
&lt;br /&gt;
''So I'm proposing to drop the *_part() suffix and have this in keeping with: matrix.to_euler(), to_quat(), to_3x3()''&lt;br /&gt;
&lt;br /&gt;
* matrix.resize3x3 --&amp;gt; resize_3x3(), better matches to_3x3().&lt;br /&gt;
&lt;br /&gt;
== Consistent Matrix Constructor Argument order == &lt;br /&gt;
At the moment Matrix constructor order is mixed.&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; mathutils.Matrix.Rotation(angle, matrix_size, axis)&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; mathutils.Matrix.Scale(factor, matrix_size, axis)&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; mathutils.Matrix.Shear(plane, factor, matrix_size)  # &amp;lt;-- Odd one out&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; mathutils.Matrix.OrthoProjection(plane, matrix_size, axis)&lt;br /&gt;
 &amp;gt;&amp;gt;&amp;gt; mathutils.Matrix.Translation(vector)&lt;/div&gt;</summary>
		<author><name>wiki&gt;Ideasman42</name></author>
		
	</entry>
</feed>