~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to release/scripts/addons/add_curve_sapling/utils.py

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
482
482
    cu = bpy.data.curves.new('tree','CURVE')
483
483
    treeOb = bpy.data.objects.new('tree',cu)
484
484
    bpy.context.scene.objects.link(treeOb)
 
485
    
 
486
    treeOb.location=bpy.context.scene.cursor_location
485
487
 
486
488
    cu.dimensions = '3D'
487
489
    cu.fill_mode = 'FULL'
759
761
            bpy.context.scene.objects.link(leafObj)
760
762
            leafObj.parent = treeOb
761
763
            leafMesh.from_pydata(leafVerts,(),leafFaces)
 
764
 
 
765
            if leafShape == 'rect':
 
766
                leafMesh.uv_textures.new("leafUV")
 
767
                uvlayer = leafMesh.uv_layers.active.data
 
768
 
 
769
                for i in range(0, len(leafFaces)):
 
770
                    uvlayer[i*4 + 0].uv = Vector((1, 0))
 
771
                    uvlayer[i*4 + 1].uv = Vector((1, 1))
 
772
                    uvlayer[i*4 + 2].uv = Vector((1 - leafScaleX, 1))
 
773
                    uvlayer[i*4 + 3].uv = Vector((1 - leafScaleX, 0))
 
774
 
762
775
            leafMesh.validate()
763
776
 
764
 
            '''
765
 
            # TODO: Broken after Bmesh merger, disable for now since default uvs are OK
766
 
            if leafShape == 'rect':
767
 
                uv = leafMesh.uv_textures.new("leafUV")
768
 
                for tf in uv.data:
769
 
                    tf.uv1, tf.uv2, tf.uv3, tf.uv4 = Vector((1, 0)), Vector((1, 1)), Vector((1 - leafScaleX, 1)), Vector((1 - leafScaleX, 0))
770
 
            '''
771
777
# This can be used if we need particle leaves
772
778
#            if (storeN == levels-1) and leaves:
773
779
#                normalList = []