﻿<?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=%E5%88%A9%E7%94%A8%E8%80%85%3ATheBusyTypist%2FGSoC2016-Mesh-Undo-Memory</id>
	<title>利用者:TheBusyTypist/GSoC2016-Mesh-Undo-Memory - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=%E5%88%A9%E7%94%A8%E8%80%85%3ATheBusyTypist%2FGSoC2016-Mesh-Undo-Memory"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:TheBusyTypist/GSoC2016-Mesh-Undo-Memory&amp;action=history"/>
	<updated>2026-09-05T04:38:24Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:TheBusyTypist/GSoC2016-Mesh-Undo-Memory&amp;diff=150899&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:TheBusyTypist/GSoC2016-Mesh-Undo-Memory&amp;diff=150899&amp;oldid=prev"/>
		<updated>2018-06-28T21:16:06Z</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日 (木) 21:16時点における版&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=%E5%88%A9%E7%94%A8%E8%80%85:TheBusyTypist/GSoC2016-Mesh-Undo-Memory&amp;diff=150898&amp;oldid=prev</id>
		<title>2016年3月5日 (土) 19:41にwiki&gt;TheBusyTypistによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=%E5%88%A9%E7%94%A8%E8%80%85:TheBusyTypist/GSoC2016-Mesh-Undo-Memory&amp;diff=150898&amp;oldid=prev"/>
		<updated>2016-03-05T19:41:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
Name: Ounan Ding&lt;br /&gt;
&lt;br /&gt;
E-mail: ounanding@gmail.com&lt;br /&gt;
&lt;br /&gt;
IRC: TheBusyTypist&lt;br /&gt;
&lt;br /&gt;
GitHub: https://github.com/thebusytypist&lt;br /&gt;
&lt;br /&gt;
Blog: http://blender.linearconstraints.net&lt;br /&gt;
&lt;br /&gt;
There is a PDF version of this proposal, which has better typesetting:&lt;br /&gt;
https://github.com/thebusytypist/gsoc-2016-doc/raw/master/proposals/mesh-undo-memory/mesh-undo-memory.pdf&lt;br /&gt;
&lt;br /&gt;
= Synopsis =&lt;br /&gt;
&lt;br /&gt;
I propose to optimize the memory usage of mesh undo.&lt;br /&gt;
&lt;br /&gt;
= Benefits to Blender =&lt;br /&gt;
&lt;br /&gt;
This project will reduce the memory usage and makes editing on detailed meshes&lt;br /&gt;
easier.&lt;br /&gt;
&lt;br /&gt;
Moreover, I will also take this chance to write or&lt;br /&gt;
to improve the documentation on Blender operator system&lt;br /&gt;
and operation history mechanism.&lt;br /&gt;
&lt;br /&gt;
= Deliverables =&lt;br /&gt;
&lt;br /&gt;
This project allows artists edit larger mesh object&lt;br /&gt;
before hitting the memory limitation.&lt;br /&gt;
The modification on the source code will be transparent&lt;br /&gt;
to the artists.&lt;br /&gt;
&lt;br /&gt;
= Project Details =&lt;br /&gt;
&lt;br /&gt;
In this section I will first review the current implementation of&lt;br /&gt;
mesh undo mechanism, and discuss the potential issues of it.&lt;br /&gt;
After that I propose several optimization ideas and estimate&lt;br /&gt;
a preliminary project schedule.&lt;br /&gt;
&lt;br /&gt;
== Review of Current Implementation ==&lt;br /&gt;
&lt;br /&gt;
In Blender, all operations on mesh object are encapsulated as&lt;br /&gt;
Blender Operators.&lt;br /&gt;
And whenever an Operator is successfully executed,&lt;br /&gt;
a snapshot of the current state will be captured and stored&lt;br /&gt;
into the operation history.&lt;br /&gt;
&lt;br /&gt;
I have a blog post[http://blender.linearconstraints.net/2016/02/28/notes-on-undo.html] on the details of the undo mechanism.&lt;br /&gt;
Generally speaking,&lt;br /&gt;
the operation history is stored in a list ''undobase''.&lt;br /&gt;
And current state, which is a ''UndoElem'' structure,&lt;br /&gt;
is pushed into the operation history.&lt;br /&gt;
&lt;br /&gt;
''UndoElem'' contains several function pointers to be filled&lt;br /&gt;
by specific object types.&lt;br /&gt;
These functions handles how current state is retrieved, duplicated&lt;br /&gt;
to the operation history,&lt;br /&gt;
and how it is restored and release on an undo command given by user.&lt;br /&gt;
In fact, this is the polymorphism in C style.&lt;br /&gt;
&lt;br /&gt;
For mesh data, the override functions are provided in&lt;br /&gt;
''editmesh_utils.c''.&lt;br /&gt;
The current strategy is&lt;br /&gt;
that the whole mesh data get duplicated and restored on the undo command,&lt;br /&gt;
which requires a lot of memory for a very detailed mesh object.&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
According to our analysis on the current implementation,&lt;br /&gt;
we can see that&lt;br /&gt;
the general optimization direction is to avoid doing the complete duplication.&lt;br /&gt;
&lt;br /&gt;
Moreover, each Operator itself has the best knowledge of how will it modify the&lt;br /&gt;
mesh data&lt;br /&gt;
and how will the result mesh data be different than the input one.&lt;br /&gt;
So we want to allow programmer customize the undo strategy&lt;br /&gt;
for different Operators&lt;br /&gt;
in order to achieve the optimal memory usage.&lt;br /&gt;
&lt;br /&gt;
Concretely, I propose following design:&lt;br /&gt;
&lt;br /&gt;
* The set of function pointers in ''UndoElem'' will be move to ''wmOperatorType'', where the programmer defines a ''wmOperator''. Thus the programmer can provide a custom undo strategy for specific Operator. We call this set of functions as &amp;quot;undo functions&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
* We pass the undo functions through ''ED_undo_push'', to ''undo_push_mesh'', where the ''UndoElem'' gets assembled. Thus the custom undo strategy can be dispatched dynamically.&lt;br /&gt;
&lt;br /&gt;
* We also have a code path that when no custom undo strategy is provided by an Operator, we fall back to the default behavior: make a complete replica and restore the memory on undo command.&lt;br /&gt;
&lt;br /&gt;
After we refactor the Operator/undo system,&lt;br /&gt;
we can consider the specific undo strategies now.&lt;br /&gt;
&lt;br /&gt;
For Operators which exhibit locality in their behavior,&lt;br /&gt;
we can store the delta data only.&lt;br /&gt;
This will reduce the memory usage dramatically.&lt;br /&gt;
&lt;br /&gt;
= Project Schedule =&lt;br /&gt;
&lt;br /&gt;
In the first two weeks I will refactor on the Operator/undo system,&lt;br /&gt;
which is proposed above.&lt;br /&gt;
In this stage only default undo strategy is used.&lt;br /&gt;
We will perform tests to ensure nothing is broken in the refactoring.&lt;br /&gt;
The memory usage will also be recorded as the baseline for later benchmarking.&lt;br /&gt;
&lt;br /&gt;
After that I start to implement the specific undo strategies for individual&lt;br /&gt;
Operators.&lt;br /&gt;
We also propose new strategies while we are proceeding.&lt;br /&gt;
We will iterate rapidly in this second stage.&lt;br /&gt;
&lt;br /&gt;
= Bio =&lt;br /&gt;
&lt;br /&gt;
Currently I am a master student from University of California, Riverside.&lt;br /&gt;
In my previous job&lt;br /&gt;
I was in charge of a particle system editor with fully undo/redo support.&lt;br /&gt;
I run a blog[http://http://blender.linearconstraints.net]&lt;br /&gt;
on Blender development. I have some articles about Blender operator&lt;br /&gt;
and operation history system there.&lt;/div&gt;</summary>
		<author><name>wiki&gt;TheBusyTypist</name></author>
		
	</entry>
</feed>