[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31084] branches/soc-2010-leifandersen: 1.
Leif Andersen
leif.a.andersen at gmail.com
Fri Aug 6 00:35:23 CEST 2010
Revision: 31084
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31084
Author: leifandersen
Date: 2010-08-06 00:35:23 +0200 (Fri, 06 Aug 2010)
Log Message:
-----------
1. Added a few more tests to the python conversions...it's not looking like I'll get done today, but I will get close.
2. Still a few more improvments to the hash operator (I've given up thinking that I won't need to upgrade it any more).
Modified Paths:
--------------
branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py
branches/soc-2010-leifandersen/tests/python/Font_example.py
branches/soc-2010-leifandersen/tests/python/Font_example.py.blend
branches/soc-2010-leifandersen/tests/python/Group_example2.py
branches/soc-2010-leifandersen/tests/python/Group_example2.py.blend
branches/soc-2010-leifandersen/tests/python/hashfile.txt
branches/soc-2010-leifandersen/tests/python/image_example.py
branches/soc-2010-leifandersen/tests/python/image_example.py.blend
branches/soc-2010-leifandersen/tests/python/lamp_modes_example.py
branches/soc-2010-leifandersen/tests/python/lamp_modes_example.py.blend
Added Paths:
-----------
branches/soc-2010-leifandersen/tests/python/.bfont.ttf
Removed Paths:
-------------
branches/soc-2010-leifandersen/tests/python/.bfont.ttf
Modified: branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py
===================================================================
--- branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py 2010-08-05 21:58:57 UTC (rev 31083)
+++ branches/soc-2010-leifandersen/release/scripts/op/tests_hash.py 2010-08-05 22:35:23 UTC (rev 31084)
@@ -30,6 +30,10 @@
for ob in scene.objects:
hashcode += hash(ob.name)
hashcode += hash(ob.type)
+ if ob.dupli_group != None:
+ hashcode += hash(ob.dupli_group.name)
+ for object in ob.dupli_group.objects:
+ hashcode += hash(object.name)
for num in ob.rotation_euler:
hashcode += hash(round(num, 6))
for num in ob.location:
@@ -235,6 +239,8 @@
hashcode += hash(ob.data.falloff_curve.clip_max_y)
for num in ob.data.falloff_curve.white_level:
hashcode += hash(num)
+ if ob.data.rna_type.name == 'Spot Lamp':
+ hashcode += hash(ob.data.shadow_method)
for num in ob.data.color:
hashcode += hash(num)
if ob.type == 'CAMERA':
@@ -255,6 +261,57 @@
hashcode += hash(ob.data.passepartout_alpha)
hashcode += hash(ob.data.draw_size)
hashcode += hash(ob.data.angle)
+ if ob.type == 'TEXT':
+ tx = ob.data
+ hashcode += hash(tx.auto_texspace)
+ hashcode += hash(tx.back)
+ hashcode += hash(tx.bevel_depth)
+ hashcode += hash(tx.bevel_resolution)
+ hashcode += hash(tx.body)
+ for letter in tx.body_format:
+ hashcode += hash(letter.bold)
+ hashcode += hash(letter.italic)
+ hashcode += hash(letter.underline)
+ hashcode += hash(tx.dimensions)
+ hashcode += hash(tx.draw_handles)
+ hashcode += hash(tx.draw_normals)
+ hashcode += hash(tx.eval_time)
+ hashcode += hash(tx.extrude)
+ hashcode += hash(tx.family)
+ hashcode += hash(tx.front)
+ if tx.font != None:
+ hashcode += hash(tx.font.name)
+ hashcode += hash(tx.line_dist)
+ hashcode += hash(tx.map_along_length)
+ hashcode += hash(tx.name)
+ hashcode += hash(tx.offset_x)
+ hashcode += hash(tx.offset_y)
+ hashcode += hash(tx.path_length)
+ hashcode += hash(tx.render_resolution_u)
+ hashcode += hash(tx.render_resolution_v)
+ hashcode += hash(tx.shear)
+ hashcode += hash(tx.spacemode)
+ hashcode += hash(tx.spacing)
+ for spline in tx.splines:
+ hashcode += hash(spline.cyclic_u)
+ hashcode += hash(spline.cyclic_v)
+ hashcode += hash(spline.type)
+ hashcode += hash(spline.resolution_u)
+ hashcode += hash(spline.resolution_v)
+ hashcode += hash(tx.tag)
+ for num in tx.texspace_loc:
+ hashcode += hash(num)
+ for num in tx.texspace_size:
+ hashcode += hash(num)
+ for box in tx.textboxes:
+ hashcode += hash(box.x)
+ hashcode += hash(box.y)
+ hashcode += hash(tx.text_size)
+ hashcode += hash(tx.ul_height)
+ hashcode += hash(tx.ul_position)
+ hashcode += hash(tx.users)
+ hashcode += hash(tx.width)
+ hashcode += hash(tx.word_spacing)
if ob.type == 'ARMATURE':
am = ob.data
hashcode += hash(am.auto_ik)
Deleted: branches/soc-2010-leifandersen/tests/python/.bfont.ttf
===================================================================
(Binary files differ)
Added: branches/soc-2010-leifandersen/tests/python/.bfont.ttf
===================================================================
(Binary files differ)
Property changes on: branches/soc-2010-leifandersen/tests/python/.bfont.ttf
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/soc-2010-leifandersen/tests/python/Font_example.py
===================================================================
--- branches/soc-2010-leifandersen/tests/python/Font_example.py 2010-08-05 21:58:57 UTC (rev 31083)
+++ branches/soc-2010-leifandersen/tests/python/Font_example.py 2010-08-05 22:35:23 UTC (rev 31084)
@@ -23,7 +23,14 @@
bpy.ops.tests.hash()
self.assertEquals(self.hash_start, tests.hashfile.last_hash)
- # Insert Here
+ txt = bpy.data.curves.new("MyText", 'TEXT') # create a new Text3d object called MyText
+ cur = bpy.context.scene # get current scene
+ ob = bpy.data.objects.new('Text', txt) # make curve object, link text
+ bpy.ops.font.open(filepath=".bfont.ttf") # here a valid font file
+ fnt_obj = bpy.data.fonts[0] # linking font
+ txt.font = fnt_obj # set font
+ cur.objects.link(ob) # link object into scene
+ cur.update()
bpy.ops.tests.hash()
self.assertEquals(self.hash_end, tests.hashfile.last_hash)
@@ -37,4 +44,4 @@
print(bpy.ops.tests.read_hashfile(filepath="hashfile.txt"))
data = tests.hashfile.data
unittest.TextTestRunner(verbosity=2).run(suite())
- bpy.ops.wm.exit_blender()
\ No newline at end of file
+ #bpy.ops.wm.exit_blender()
\ No newline at end of file
Modified: branches/soc-2010-leifandersen/tests/python/Font_example.py.blend
===================================================================
(Binary files differ)
Modified: branches/soc-2010-leifandersen/tests/python/Group_example2.py
===================================================================
--- branches/soc-2010-leifandersen/tests/python/Group_example2.py 2010-08-05 21:58:57 UTC (rev 31083)
+++ branches/soc-2010-leifandersen/tests/python/Group_example2.py 2010-08-05 22:35:23 UTC (rev 31084)
@@ -23,8 +23,17 @@
bpy.ops.tests.hash()
self.assertEquals(self.hash_start, tests.hashfile.last_hash)
- # Insert Here
+ # New Group
+ scn = bpy.context.scene
+ gp = bpy.data.groups.new('mygroup')
+ bpy.ops.group.objects_add_active()
+ # Instance the group at an empty using dupligroups
+ ob = bpy.data.objects.new('Empty', None)
+ scn.objects.link(ob)
+ ob.dupli_group = gp
+ scn.update()
+
bpy.ops.tests.hash()
self.assertEquals(self.hash_end, tests.hashfile.last_hash)
Modified: branches/soc-2010-leifandersen/tests/python/Group_example2.py.blend
===================================================================
(Binary files differ)
Modified: branches/soc-2010-leifandersen/tests/python/hashfile.txt
===================================================================
--- branches/soc-2010-leifandersen/tests/python/hashfile.txt 2010-08-05 21:58:57 UTC (rev 31083)
+++ branches/soc-2010-leifandersen/tests/python/hashfile.txt 2010-08-05 22:35:23 UTC (rev 31084)
@@ -7,4 +7,12 @@
Constraint_example2.py.blend_start = -207409205650300112139
Constraint_example2.py.blend_end = -207409205650300112138
effect_example.py.blend_start = -20522026236656192644
-effect_example.py.blend_end = -20522026236656192194
\ No newline at end of file
+effect_example.py.blend_end = -20522026236656192194
+Font_example.py.blend_start = -22262356698404542388
+Font_example.py.blend_end = -60195516037617288890
+Group_example2.py.blend_start = -2748352640926596867
+Group_example2.py.blend_end = -7145151643561397340
+image_example.py.blend_start = -14300758262507746666
+image_example.py.blend_end = -5745724874654974270
+lamp_modes_example.py.blend_start = -15330808205140559615
+lamp_modes_example.py.blend_end = -29347588579616917852
\ No newline at end of file
Modified: branches/soc-2010-leifandersen/tests/python/image_example.py
===================================================================
--- branches/soc-2010-leifandersen/tests/python/image_example.py 2010-08-05 21:58:57 UTC (rev 31083)
+++ branches/soc-2010-leifandersen/tests/python/image_example.py 2010-08-05 22:35:23 UTC (rev 31084)
@@ -23,10 +23,16 @@
bpy.ops.tests.hash()
self.assertEquals(self.hash_start, tests.hashfile.last_hash)
- # Insert Here
+ image = bpy.data.images.new("test.png")
+ print("Image from", image.filepath)
+ print("loaded to obj", image.name)
+ image.tiles_x = 4
+ image.tiles_y = 2
+ print("All Images available now:", image)
bpy.ops.tests.hash()
- self.assertEquals(self.hash_end, tests.hashfile.last_hash)
+ self.assertEquals(self.hash_end,
+ tests.hashfile.last_hash + hash(image.filepath) + hash(image.name) + hash(image.tiles_x + image.tiles_y))
def suite():
return unittest.TestSuite([
Modified: branches/soc-2010-leifandersen/tests/python/image_example.py.blend
===================================================================
(Binary files differ)
Modified: branches/soc-2010-leifandersen/tests/python/lamp_modes_example.py
===================================================================
--- branches/soc-2010-leifandersen/tests/python/lamp_modes_example.py 2010-08-05 21:58:57 UTC (rev 31083)
+++ branches/soc-2010-leifandersen/tests/python/lamp_modes_example.py 2010-08-05 22:35:23 UTC (rev 31084)
@@ -23,8 +23,13 @@
bpy.ops.tests.hash()
self.assertEquals(self.hash_start, tests.hashfile.last_hash)
- # Insert Here
-
+ # Change the mode of selected lamp objects.
+ for ob in bpy.context.selected_objects: # Loop through the current selection
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list