[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4339] tags/2_66a_release/py/scripts/ addons: svn merge ^/trunk/py/scripts/ addons -c4320 -c4321 -c4325 -c4327 -c4334 -c4335
Campbell Barton
ideasman42 at gmail.com
Mon Mar 4 14:09:15 CET 2013
Revision: 4339
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4339
Author: campbellbarton
Date: 2013-03-04 13:09:15 +0000 (Mon, 04 Mar 2013)
Log Message:
-----------
svn merge ^/trunk/py/scripts/addons -c4320 -c4321 -c4325 -c4327 -c4334 -c4335
Modified Paths:
--------------
tags/2_66a_release/py/scripts/addons/io_scene_x3d/export_x3d.py
tags/2_66a_release/py/scripts/addons/io_scene_x3d/import_x3d.py
tags/2_66a_release/py/scripts/addons/io_sequencer_edl/__init__.py
tags/2_66a_release/py/scripts/addons/rigify/CREDITS
tags/2_66a_release/py/scripts/addons/rigify/README
tags/2_66a_release/py/scripts/addons/rigify/__init__.py
tags/2_66a_release/py/scripts/addons/rigify/generate.py
tags/2_66a_release/py/scripts/addons/rigify/metarigs/human.py
tags/2_66a_release/py/scripts/addons/rigify/rig_lists.py
tags/2_66a_release/py/scripts/addons/rigify/rig_ui_template.py
tags/2_66a_release/py/scripts/addons/rigify/rigs/biped/arm/__init__.py
tags/2_66a_release/py/scripts/addons/rigify/rigs/biped/arm/deform.py
tags/2_66a_release/py/scripts/addons/rigify/rigs/biped/arm/fk.py
tags/2_66a_release/py/scripts/addons/rigify/rigs/biped/arm/ik.py
tags/2_66a_release/py/scripts/addons/rigify/rigs/biped/leg/__init__.py
tags/2_66a_release/py/scripts/addons/rigify/rigs/biped/leg/deform.py
tags/2_66a_release/py/scripts/addons/rigify/rigs/biped/leg/fk.py
tags/2_66a_release/py/scripts/addons/rigify/rigs/biped/leg/ik.py
tags/2_66a_release/py/scripts/addons/rigify/rigs/misc/delta.py
tags/2_66a_release/py/scripts/addons/rigify/rigs/neck_short.py
tags/2_66a_release/py/scripts/addons/rigify/rigs/spine.py
tags/2_66a_release/py/scripts/addons/rigify/utils.py
Added Paths:
-----------
tags/2_66a_release/py/scripts/addons/rigify/rigs/biped/limb_common.py
Property Changed:
----------------
tags/2_66a_release/py/scripts/addons/
Property changes on: tags/2_66a_release/py/scripts/addons
___________________________________________________________________
Added: svn:mergeinfo
+ /trunk/py/scripts/addons:4320-4321,4325,4327,4334-4335
Modified: tags/2_66a_release/py/scripts/addons/io_scene_x3d/export_x3d.py
===================================================================
--- tags/2_66a_release/py/scripts/addons/io_scene_x3d/export_x3d.py 2013-03-04 11:40:42 UTC (rev 4338)
+++ tags/2_66a_release/py/scripts/addons/io_scene_x3d/export_x3d.py 2013-03-04 13:09:15 UTC (rev 4339)
@@ -1308,7 +1308,7 @@
images = [f.replace('\\', '/') for f in images]
images = [f for i, f in enumerate(images) if f not in images[:i]]
- fw(ident_step + "url='%s' " % ' '.join(['"%s"' % escape(f) for f in images]))
+ fw(ident_step + "url='%s'\n" % ' '.join(['"%s"' % escape(f) for f in images]))
fw(ident_step + '/>\n')
def writeBackground(ident, world):
Modified: tags/2_66a_release/py/scripts/addons/io_scene_x3d/import_x3d.py
===================================================================
--- tags/2_66a_release/py/scripts/addons/io_scene_x3d/import_x3d.py 2013-03-04 11:40:42 UTC (rev 4338)
+++ tags/2_66a_release/py/scripts/addons/io_scene_x3d/import_x3d.py 2013-03-04 13:09:15 UTC (rev 4339)
@@ -1701,7 +1701,7 @@
for j, uv in enumerate(f.uv):
# print(fuv, j, len(ifs_texpoints))
try:
- f.uv[j] = ifs_texpoints[fuv[j]] # XXX25, speedup
+ f.uv[j] = ifs_texpoints[fuv[j] + 1] # XXX25, speedup
except:
print('\tWarning: UV Index out of range')
f.uv[j] = ifs_texpoints[0] # XXX25, speedup
@@ -2050,7 +2050,7 @@
bpyima = None
texmtx = None
- depth = 0 # so we can set alpha face flag later
+ image_depth = 0 # so we can set alpha face flag later
is_vcol = (geom.getChildBySpec('Color') is not None)
if appr:
@@ -2077,7 +2077,7 @@
mat = ima # This is a bit dumb, but just means we use default values for all
# all values between 0.0 and 1.0, defaults from VRML docs
- bpymat = bpy.data.materials.new("XXX")
+ bpymat = bpy.data.materials.new(vrmlname)
bpymat.ambient = mat.getFieldAsFloat('ambientIntensity', 0.2, ancestry)
bpymat.diffuse_color = mat.getFieldAsFloatTuple('diffuseColor', [0.8, 0.8, 0.8], ancestry)
@@ -2096,40 +2096,51 @@
bpymat.use_vertex_color_paint = True
if ima:
- ima_url = ima.getFieldAsString('url', None, ancestry)
+ ima_urls = ima.getFieldAsString('url', None, ancestry)
- if ima_url is None:
+ if ima_urls is None:
try:
- ima_url = ima.getFieldAsStringArray('url', ancestry)[0] # in some cases we get a list of images.
+ ima_urls = ima.getFieldAsStringArray('url', ancestry) # in some cases we get a list of images.
except:
- ima_url = None
-
- if ima_url is None:
+ ima_urls = None
+ else:
+ if '" "' in ima_urls:
+ # '"foo" "bar"' --> ['foo', 'bar']
+ ima_urls = [w.strip('"') for w in ima_urls.split('" "')]
+ else:
+ ima_urls = [ima_urls]
+ # ima_urls is a list or None
+
+ if ima_urls is None:
print("\twarning, image with no URL, this is odd")
else:
- bpyima = image_utils.load_image(ima_url, os.path.dirname(node.getFilename()), place_holder=False, recursive=False, convert_callback=imageConvertCompat)
+ bpyima = None
+ for f in ima_urls:
+ bpyima = image_utils.load_image(f, os.path.dirname(node.getFilename()), place_holder=False, recursive=False, convert_callback=imageConvertCompat)
+ if bpyima:
+ break
+
if bpyima:
- texture = bpy.data.textures.new("XXX", 'IMAGE')
+ texture = bpy.data.textures.new(bpyima.name, 'IMAGE')
texture.image = bpyima
# Adds textures for materials (rendering)
try:
- depth = bpyima.depth
+ image_depth = bpyima.depth
except:
- depth = -1
+ image_depth = -1
+
+ mtex = bpymat.texture_slots.add()
+ mtex.texture = texture
- if depth == 32:
- # Image has alpha
- bpymat.setTexture(0, texture, Texture.TexCo.UV, Texture.MapTo.COL | Texture.MapTo.ALPHA)
- texture.setImageFlags('MipMap', 'InterPol', 'UseAlpha')
- bpymat.mode |= Material.Modes.ZTRANSP
- bpymat.alpha = 0.0
- else:
- mtex = bpymat.texture_slots.add()
- mtex.texture = texture
- mtex.texture_coords = 'UV'
- mtex.use_map_diffuse = True
+ mtex.texture_coords = 'UV'
+ mtex.use_map_diffuse = True
+ if image_depth in {32, 128}:
+ bpymat.use_transparency = True
+ mtex.use_map_alpha = True
+ mtex.alpha_factor = 0.0
+
ima_repS = ima.getFieldAsBool('repeatS', True, ancestry)
ima_repT = ima.getFieldAsBool('repeatT', True, ancestry)
@@ -2184,7 +2195,7 @@
if bpydata.tessface_uv_textures:
- if depth == 32: # set the faces alpha flag?
+ if image_depth in {32, 128}: # set the faces alpha flag?
transp = Mesh.FaceTranspModes.ALPHA
for f in bpydata.tessface_uv_textures.active.data:
f.blend_type = 'ALPHA'
Modified: tags/2_66a_release/py/scripts/addons/io_sequencer_edl/__init__.py
===================================================================
--- tags/2_66a_release/py/scripts/addons/io_sequencer_edl/__init__.py 2013-03-04 11:40:42 UTC (rev 4338)
+++ tags/2_66a_release/py/scripts/addons/io_sequencer_edl/__init__.py 2013-03-04 13:09:15 UTC (rev 4339)
@@ -29,7 +29,7 @@
"wiki_url": "http://wiki.blender.org/index.php/Extensions:"
"2.6/Py/Scripts/Import-Export/EDL_Import",
"tracker_url": "",
- "category": "Import"}
+ "category": "Import-Export"}
import bpy
Modified: tags/2_66a_release/py/scripts/addons/rigify/CREDITS
===================================================================
--- tags/2_66a_release/py/scripts/addons/rigify/CREDITS 2013-03-04 11:40:42 UTC (rev 4338)
+++ tags/2_66a_release/py/scripts/addons/rigify/CREDITS 2013-03-04 13:09:15 UTC (rev 4339)
@@ -7,6 +7,7 @@
- Benjamin Tolputt
- Nesterenko Viktoriya
- Jeff Hogan
+- Pitchi Poy productions
IK/FK snapping financial support:
- Benjamin Tolputt
Modified: tags/2_66a_release/py/scripts/addons/rigify/README
===================================================================
--- tags/2_66a_release/py/scripts/addons/rigify/README 2013-03-04 11:40:42 UTC (rev 4338)
+++ tags/2_66a_release/py/scripts/addons/rigify/README 2013-03-04 13:09:15 UTC (rev 4339)
@@ -70,8 +70,9 @@
THE GUTS OF A RIG TYPE, BASIC
-----------------------------
-A rig type is simply a python module containing a class named "Rig". The Rig
-class is only required to have two methods: __init__() and generate()
+A rig type is simply a python module containing a class named "Rig", and some
+optional module functions. The Rig class has only two methods:
+__init__() and generate()
__init__() is the "information gathering" code for the rig type. When Rigify
loops through the bones and finds a tagged bone, it will create a python
@@ -85,7 +86,7 @@
# code goes here
At the bare minimum, you are going to want to store the object and bone name
-in the rig type object for later reference in the generate method. So:
+in the rig type object for later reference in the generate() method. So:
def __init__(self, obj, bone_name, params):
self.obj = obj
@@ -163,17 +164,11 @@
THE GUTS OF A RIG TYPE, ADVANCED
--------------------------------
If you look at any of the rig types included with Rigify, you'll note that they
-have several more methods than just __init__() and generate().
-THESE ADDITIONAL METHODS ARE _NOT_ REQUIRED for a rig type to function. But
+have several functions outside of the Rig class.
+THESE ADDITIONAL FUNCTIONS ARE _NOT_ REQUIRED for a rig type to function. But
they can add some nifty functionality to your rig.
-Not all of the additional methods you see in the included rig types have any
-special purpose for Rigify, however. For example, I often create separate
-methods for generating the deformation and control rigs, and then call them
-both from the main generate() method. But that is just for organization, and
-has nothing to do with Rigify itself.
-
-Here are the additional methods relevant to Rigify, with brief decriptions of
+Here are the additional functions relevant to Rigify, with brief decriptions of
what they are for:
@@ -183,25 +178,21 @@
generated. For example, the included biped arm rig allows the user to specify
the axis of rotation for the elbow.
-There are two methods necessary to give a rig type user-tweakable parameters,
-both of which must be class methods:
+There are two functions necessary to give a rig type user-tweakable parameters:
add_parameters()
parameters_ui()
add_parameters() takes an IDPropertyGroup as input, and adds its parameters
to that group as RNA properties. For example:
- @classmethod
- def add_parameters(self, group):
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list