3535bl_info = {
3636 "name" : "Modular trees" ,
3737 "author" : "Herpin Maxime, Jake Dube" ,
38- "version" : (2 , 8 , 0 ),
38+ "version" : (2 , 8 , 1 ),
3939 "blender" : (2 , 77 , 0 ),
4040 "location" : "View3D > Tools > Tree > Make Tree" ,
4141 "description" : "Generates an organic tree with correctly modeled branching." ,
@@ -256,6 +256,13 @@ def draw(self, context):
256256 box .prop_search (mtree_props , "obstacle" , scene , "objects" )
257257 if bpy .data .objects .get (mtree_props .obstacle ) is not None :
258258 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' )
259266
260267
261268class AdvancedSettingsPanel (Panel ):
@@ -270,6 +277,7 @@ class AdvancedSettingsPanel(Panel):
270277 def draw (self , context ):
271278 mtree_props = context .scene .mtree_props
272279 layout = self .layout
280+ scene = context .scene
273281
274282 box = layout .box ()
275283 box .prop (mtree_props , 'mat' )
@@ -284,6 +292,8 @@ def draw(self, context):
284292 if mtree_props .particle :
285293 box .prop (mtree_props , 'number' )
286294 box .prop (mtree_props , 'display' )
295+ box .prop_search (mtree_props , "twig_particle" , scene , "objects" )
296+ box .prop (mtree_props , 'particle_size' )
287297
288298
289299class WindAnimationPanel (Panel ):
@@ -325,6 +335,7 @@ class MakeTwigPanel(Panel):
325335 def draw (self , context ):
326336 mtree_props = context .scene .mtree_props
327337 layout = self .layout
338+ scene = context .scene
328339
329340 row = layout .row ()
330341 row .scale_y = 1.5
@@ -337,11 +348,12 @@ def draw(self, context):
337348 box = layout .box ()
338349 box .label ("Twig Options" )
339350 box .prop (mtree_props , "leaf_size" )
351+ box .prop_search (mtree_props , "leaf_object" , scene , "objects" )
340352 box .prop (mtree_props , "leaf_chance" )
353+ box .prop (mtree_props , "leaf_weight" )
341354 box .prop (mtree_props , "TwigSeedProp" )
342355 box .prop (mtree_props , "twig_iteration" )
343356 box .prop_search (mtree_props , "twig_bark_material" , bpy .data , "materials" )
344- box .prop_search (mtree_props , "twig_leaf_material" , bpy .data , "materials" )
345357
346358
347359class MakeTreePresetsPanel (Panel ):
@@ -541,10 +553,10 @@ class ModularTreePropertyGroup(PropertyGroup):
541553 description = "randomize the rotation of branches angle" )
542554
543555 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" )
548560
549561 particle = BoolProperty (
550562 name = "Configure Particle System" ,
@@ -558,6 +570,15 @@ class ModularTreePropertyGroup(PropertyGroup):
558570 name = "Particles in Viewport" ,
559571 default = 500 )
560572
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+
561582 break_chance = FloatProperty (
562583 name = "Break Chance" ,
563584 default = 0.02 )
@@ -575,8 +596,11 @@ class ModularTreePropertyGroup(PropertyGroup):
575596 min = 0 ,
576597 default = .5 )
577598
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 )
580604
581605 twig_bark_material = StringProperty (
582606 name = "Twig Bark Material" )
@@ -591,6 +615,11 @@ class ModularTreePropertyGroup(PropertyGroup):
591615 soft_max = 10 ,
592616 default = 9 )
593617
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+
594623 tree_number = IntProperty (
595624 name = "Tree Number" ,
596625 min = 2 ,
@@ -630,21 +659,48 @@ class ModularTreePropertyGroup(PropertyGroup):
630659 description = "The distance from the terrain that the wind effect is at its highest" )
631660
632661 use_grease_pencil = BoolProperty (
633- name = "Use Grease Pencil" ,
634- default = False )
662+ name = "Use Grease Pencil" ,
663+ default = False )
635664
636665 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 )
641670
642671 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." )
646703
647-
648704 clear_mods = BoolProperty (name = "Clear Modifiers" , default = True )
649705
650706 wind_strength = FloatProperty (name = "Wind Strength" , default = 1 )
0 commit comments