Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter customizer #16

Merged
merged 43 commits into from
Feb 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
071375b
Base implementation
Sep 30, 2018
620e9c4
Ignore .idea folder (PyCharm preferences)
Sep 30, 2018
c9da1ae
Replace placeholders with proper properties
Sep 30, 2018
a5a5fbc
Get all options displaying; prettify
Oct 1, 2018
bf8bcf5
Merge remote-tracking branch 'upstream/master' into parameter-customizer
Oct 1, 2018
d02deaf
Make scene params match normal params
Dec 5, 2018
c7f130c
Fix permissions issue; ensure Tree object gets dereferenced
Dec 5, 2018
4431232
Add ability to save custom config to a file
Dec 7, 2018
134e7be
Remove debug print statement
Dec 7, 2018
9569af6
Add random split functionality, improve scene handling safety
Dec 7, 2018
68be0b1
Debugging
Dec 7, 2018
0cd2496
Merge branch 'master' into parameter-customizer
Dec 7, 2018
a829a6b
Merge remote-tracking branch 'upstream/master' into parameter-customizer
Dec 7, 2018
5232f74
Debugging
Dec 8, 2018
336e5a6
Merge branch 'performance-improvements' into parameter-customizer
Dec 8, 2018
590ba05
Finish merging optimizations into customizer
Dec 8, 2018
ff6891f
Cleanup old code; memory management
Dec 8, 2018
ffa07b0
Error handling
Dec 8, 2018
af492bc
Merge branch 'master' into parameter-customizer
Dec 9, 2018
1189266
Add vector param inputs
Dec 11, 2018
738035e
Add missing params, fix rendering, add preset loading to customizer
Dec 11, 2018
4164c81
Revert render changes
Dec 11, 2018
b30d06b
Merge branch 'master' into parameter-customizer
Dec 11, 2018
0d6bdd3
-.01 to 0
Dec 11, 2018
e968c6e
Box spacing fix
Dec 11, 2018
dd81bfb
update ui
friggog Jan 26, 2019
d49dd0c
blossom changes
friggog Jan 26, 2019
1f6d8aa
fix param loading and UI improvements
friggog Jan 26, 2019
3b92dbc
better douglas firt
friggog Jan 26, 2019
2edb715
update ignore
friggog Jan 26, 2019
2356e5b
remove l systems
friggog Jan 26, 2019
362fe03
fix base splits
friggog Jan 26, 2019
827fdfe
tidy up
friggog Jan 26, 2019
0b31cc3
tidy up
friggog Jan 26, 2019
d9dd830
fix pruning
friggog Jan 26, 2019
8ac184f
better cam oak
friggog Jan 26, 2019
4ad36ca
fix leaf param
friggog Jan 26, 2019
79ae6c0
load aspen by default
friggog Jan 26, 2019
9a5cddc
floor splits to branches[0] and better small pine
friggog Jan 27, 2019
78fc0cc
tooltips and ui updates
friggog Jan 27, 2019
1487c2c
tidy
friggog Jan 27, 2019
60fc4b0
fix curve back limits
friggog Feb 3, 2019
181943a
simplify leaf bend
friggog Feb 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.DS_Store

# PyCharm user preferences
.idea/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -107,4 +112,4 @@ venv.bak/
# ========
build.bat
staging/
.idea/
.idea/
12 changes: 12 additions & 0 deletions ch_trees/__init__.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
bl_info = {
"name": "TreeGen",
"category": "Object",
"description": "Generate high quality tree models",
"author": "Charlie Hewitt and Luke Pflibsen-Jones",
"version": (0, 0, 1),
"wiki_url": "",
}


import bpy
from . import gui


def register():
bpy.utils.register_class(gui.TreeGen)
bpy.utils.register_class(gui.TreeGenPanel)
bpy.utils.register_class(gui.TreeGenCustomisePanel)
bpy.utils.register_class(gui.TreeGenSaveFile)
bpy.utils.register_class(gui.TreeGenLoadParams)


def unregister():
# Reversing order is best-practice
bpy.utils.unregister_class(gui.TreeGenLoadParams)
bpy.utils.unregister_class(gui.TreeGenSaveFile)
bpy.utils.register_class(gui.TreeGenCustomisePanel)
bpy.utils.unregister_class(gui.TreeGenPanel)
bpy.utils.unregister_class(gui.TreeGen)

Expand Down
494 changes: 393 additions & 101 deletions ch_trees/gui.py
100644 → 100755

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions ch_trees/leaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_mesh(self, bend, base_shape, index):
if bend > 0:
bend_trf_1, bend_trf_2 = self.calc_bend_trf(bend)
else:
bend_trf_1 = bend_trf_2 = None
bend_trf_1 = None

vertices = []
for vertex in base_shape[0]:
Expand All @@ -71,7 +71,7 @@ def get_mesh(self, bend, base_shape, index):
# apply bend if needed
if bend > 0:
n_vertex.rotate(bend_trf_1)
n_vertex.rotate(bend_trf_2)
# n_vertex.rotate(bend_trf_2)

# move to right position
n_vertex += self.position
Expand All @@ -92,6 +92,10 @@ def calc_bend_trf(self, bend):
theta_pos = atan2(self.position.y, self.position.x)
theta_bend = theta_pos - atan2(normal.y, normal.x)
bend_trf_1 = Quaternion(Vector([0, 0, 1]), theta_bend * bend)

# i think this is what the paper says but the second transform just looks stupid
# so we just ignore it above

self.direction.rotate(bend_trf_1)
self.right.rotate(bend_trf_1)
normal = self.direction.cross(self.right)
Expand Down
2 changes: 0 additions & 2 deletions ch_trees/lsystems/__init__.py

This file was deleted.

14 changes: 0 additions & 14 deletions ch_trees/lsystems/gen.py

This file was deleted.

Loading