35
35
bl_info = {
36
36
"name" : "Modular trees" ,
37
37
"author" : "Herpin Maxime, Jake Dube" ,
38
- "version" : (2 , 8 , 0 ),
38
+ "version" : (2 , 8 , 1 ),
39
39
"blender" : (2 , 77 , 0 ),
40
40
"location" : "View3D > Tools > Tree > Make Tree" ,
41
41
"description" : "Generates an organic tree with correctly modeled branching." ,
@@ -256,6 +256,13 @@ def draw(self, context):
256
256
box .prop_search (mtree_props , "obstacle" , scene , "objects" )
257
257
if bpy .data .objects .get (mtree_props .obstacle ) is not None :
258
258
box .prop (mtree_props , 'obstacle_strength' )
259
+ col1 = box .column ()
260
+ col1 .prop (mtree_props , 'use_force_field' )
261
+ if mtree_props .use_force_field :
262
+ col1 .prop (mtree_props , 'fields_point_strength' )
263
+ col1 .prop (mtree_props , 'fields_point_strength' )
264
+ col1 .prop (mtree_props , 'fields_strength_limit' )
265
+ col1 .prop (mtree_props , 'fields_radius_factor' )
259
266
260
267
261
268
class AdvancedSettingsPanel (Panel ):
@@ -270,6 +277,7 @@ class AdvancedSettingsPanel(Panel):
270
277
def draw (self , context ):
271
278
mtree_props = context .scene .mtree_props
272
279
layout = self .layout
280
+ scene = context .scene
273
281
274
282
box = layout .box ()
275
283
box .prop (mtree_props , 'mat' )
@@ -284,6 +292,8 @@ def draw(self, context):
284
292
if mtree_props .particle :
285
293
box .prop (mtree_props , 'number' )
286
294
box .prop (mtree_props , 'display' )
295
+ box .prop_search (mtree_props , "twig_particle" , scene , "objects" )
296
+ box .prop (mtree_props , 'particle_size' )
287
297
288
298
289
299
class WindAnimationPanel (Panel ):
@@ -325,6 +335,7 @@ class MakeTwigPanel(Panel):
325
335
def draw (self , context ):
326
336
mtree_props = context .scene .mtree_props
327
337
layout = self .layout
338
+ scene = context .scene
328
339
329
340
row = layout .row ()
330
341
row .scale_y = 1.5
@@ -337,11 +348,12 @@ def draw(self, context):
337
348
box = layout .box ()
338
349
box .label ("Twig Options" )
339
350
box .prop (mtree_props , "leaf_size" )
351
+ box .prop_search (mtree_props , "leaf_object" , scene , "objects" )
340
352
box .prop (mtree_props , "leaf_chance" )
353
+ box .prop (mtree_props , "leaf_weight" )
341
354
box .prop (mtree_props , "TwigSeedProp" )
342
355
box .prop (mtree_props , "twig_iteration" )
343
356
box .prop_search (mtree_props , "twig_bark_material" , bpy .data , "materials" )
344
- box .prop_search (mtree_props , "twig_leaf_material" , bpy .data , "materials" )
345
357
346
358
347
359
class MakeTreePresetsPanel (Panel ):
@@ -541,10 +553,10 @@ class ModularTreePropertyGroup(PropertyGroup):
541
553
description = "randomize the rotation of branches angle" )
542
554
543
555
branch_min_radius = FloatProperty (
544
- name = "Branches minimum radius" ,
545
- default = .04 ,
546
- min = 0 ,
547
- description = "radius at which a branch breaks for being to small" )
556
+ name = "Branches minimum radius" ,
557
+ default = .04 ,
558
+ min = 0 ,
559
+ description = "radius at which a branch breaks for being to small" )
548
560
549
561
particle = BoolProperty (
550
562
name = "Configure Particle System" ,
@@ -558,6 +570,15 @@ class ModularTreePropertyGroup(PropertyGroup):
558
570
name = "Particles in Viewport" ,
559
571
default = 500 )
560
572
573
+ twig_particle = StringProperty (
574
+ name = 'twig or leaf object' ,
575
+ default = '' )
576
+
577
+ particle_size = FloatProperty (
578
+ name = "twig/leaf size" ,
579
+ min = 0 ,
580
+ default = 1.5 )
581
+
561
582
break_chance = FloatProperty (
562
583
name = "Break Chance" ,
563
584
default = 0.02 )
@@ -575,8 +596,11 @@ class ModularTreePropertyGroup(PropertyGroup):
575
596
min = 0 ,
576
597
default = .5 )
577
598
578
- twig_leaf_material = StringProperty (
579
- name = "Leaf Material" )
599
+ leaf_weight = FloatProperty (
600
+ name = "Leaf Weight" ,
601
+ min = 0 ,
602
+ max = 1 ,
603
+ default = .2 )
580
604
581
605
twig_bark_material = StringProperty (
582
606
name = "Twig Bark Material" )
@@ -591,6 +615,11 @@ class ModularTreePropertyGroup(PropertyGroup):
591
615
soft_max = 10 ,
592
616
default = 9 )
593
617
618
+ leaf_object = StringProperty (
619
+ name = "leaf object" ,
620
+ default = "" ,
621
+ description = "The object used for the leaves. \n The leaf must be on Y axis and the rotation must be applied" )
622
+
594
623
tree_number = IntProperty (
595
624
name = "Tree Number" ,
596
625
min = 2 ,
@@ -630,21 +659,48 @@ class ModularTreePropertyGroup(PropertyGroup):
630
659
description = "The distance from the terrain that the wind effect is at its highest" )
631
660
632
661
use_grease_pencil = BoolProperty (
633
- name = "Use Grease Pencil" ,
634
- default = False )
662
+ name = "Use Grease Pencil" ,
663
+ default = False )
635
664
636
665
smooth_stroke = FloatProperty (
637
- name = "Smooth Iterations" ,
638
- min = 0.0 ,
639
- max = 1 ,
640
- default = .2 )
666
+ name = "Smooth Iterations" ,
667
+ min = 0.0 ,
668
+ max = 1 ,
669
+ default = .2 )
641
670
642
671
stroke_step_size = FloatProperty (
643
- name = "Step Size" ,
644
- min = 0 ,
645
- default = .5 )
672
+ name = "Step Size" ,
673
+ min = 0 ,
674
+ default = .5 )
675
+
676
+ use_force_field = BoolProperty (
677
+ name = "Use Force Field" ,
678
+ default = False )
679
+
680
+ fields_point_strength = FloatProperty (
681
+ name = "Point Force Strength" ,
682
+ min = 0.0 ,
683
+ default = 1 )
684
+
685
+ fields_wind_strength = FloatProperty (
686
+ name = "Wind Force Strength" ,
687
+ min = 0.0 ,
688
+ default = 1 )
689
+
690
+ fields_strength_limit = FloatProperty (
691
+ name = "Strength Limit" ,
692
+ min = 0 ,
693
+ default = 10 ,
694
+ description = "limits the force so that it can't approaches infinity" )
695
+
696
+ fields_radius_factor = FloatProperty (
697
+ name = "Radius Factor" ,
698
+ min = 0 ,
699
+ max = 1 ,
700
+ default = .5 ,
701
+ description = "How the branch radius affects the force strength. "
702
+ "\n 0 means big branches are as affected as small ones." )
646
703
647
-
648
704
clear_mods = BoolProperty (name = "Clear Modifiers" , default = True )
649
705
650
706
wind_strength = FloatProperty (name = "Wind Strength" , default = 1 )
0 commit comments