Skip to content
Snippets Groups Projects
Commit 6b83cb96 authored by Campbell Barton's avatar Campbell Barton
Browse files

updates for blender api changes

parent 1a45c5c8
No related branches found
No related tags found
No related merge requests found
...@@ -622,8 +622,8 @@ def parseActionFCurve(act, ob, args, tokens): ...@@ -622,8 +622,8 @@ def parseActionFCurve(act, ob, args, tokens):
def parseKeyFramePoint(pt, args, tokens): def parseKeyFramePoint(pt, args, tokens):
pt.co = (float(args[0]), float(args[1])) pt.co = (float(args[0]), float(args[1]))
if len(args) > 2: if len(args) > 2:
pt.handle1 = (float(args[2]), float(args[3])) pt.handle_left = (float(args[2]), float(args[3]))
pt.handle2 = (float(args[3]), float(args[5])) pt.handle_right = (float(args[3]), float(args[5]))
return pt return pt
# #
...@@ -909,7 +909,7 @@ def parseImage(args, tokens): ...@@ -909,7 +909,7 @@ def parseImage(args, tokens):
return None return None
img.name = imgName img.name = imgName
else: else:
defaultKey(key, val, sub, "img", ['depth', 'dirty', 'has_data', 'size', 'type'], globals(), locals()) defaultKey(key, val, sub, "img", ['depth', 'is_dirty', 'has_data', 'size', 'type'], globals(), locals())
print ("Image %s" % img ) print ("Image %s" % img )
loadedData['Image'][imgName] = img loadedData['Image'][imgName] = img
return img return img
...@@ -1055,7 +1055,7 @@ def parseParticle(par, args, tokens): ...@@ -1055,7 +1055,7 @@ def parseParticle(par, args, tokens):
n = 0 n = 0
for (key, val, sub) in tokens: for (key, val, sub) in tokens:
if key == 'h': if key == 'h':
h = par.hair[n] h = par.is_hair[n]
h.location = eval(val[0]) h.location = eval(val[0])
h.time = int(val[1]) h.time = int(val[1])
h.weight = float(val[2]) h.weight = float(val[2])
...@@ -1615,7 +1615,7 @@ def insertInfluenceIpo(cns, bone): ...@@ -1615,7 +1615,7 @@ def insertInfluenceIpo(cns, bone):
var.targets[0].bone_target = bone var.targets[0].bone_target = bone
var.targets[0].transform_type = 'LOC_X' var.targets[0].transform_type = 'LOC_X'
# controller_path = fk_chain.arm_p.path_to_id() # controller_path = fk_chain.arm_p.path_to_id()
#var.targets[0].data_path = controller_path + '["hinge"]' #var.targets[0].data_path = controller_path + '["use_hinge"]'
mod = fcurve.modifiers[0] mod = fcurve.modifiers[0]
mod.poly_order = 2 mod.poly_order = 2
...@@ -1680,10 +1680,10 @@ def parseNurb(cu, nNurbs, args, tokens): ...@@ -1680,10 +1680,10 @@ def parseNurb(cu, nNurbs, args, tokens):
def parseBezier(nurb, n, args, tokens): def parseBezier(nurb, n, args, tokens):
bez = nurb[n] bez = nurb[n]
bez.co = eval(args[0]) bez.co = eval(args[0])
bez.handle1 = eval(args[1]) bez.handle_left = eval(args[1])
bez.handle1_type = args[2] bez.handle_left_type = args[2]
bez.handle2 = eval(args[3]) bez.handle_right = eval(args[3])
bez.handle2_type = args[4] bez.handle_right_type = args[4]
return return
def parsePoint(nurb, n, args, tokens): def parsePoint(nurb, n, args, tokens):
...@@ -1853,7 +1853,7 @@ def parseProcess(args, tokens): ...@@ -1853,7 +1853,7 @@ def parseProcess(args, tokens):
for (bname, pname) in parents.items(): for (bname, pname) in parents.items():
eb = ebones[bname] eb = ebones[bname]
par = ebones[pname] par = ebones[pname]
if eb.connected: if eb.use_connect:
par.tail = eb.head par.tail = eb.head
eb.parent = par eb.parent = par
bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.mode_set(mode='OBJECT')
......
...@@ -535,10 +535,10 @@ class GenerateCloud(bpy.types.Operator): ...@@ -535,10 +535,10 @@ class GenerateCloud(bpy.types.Operator):
vMaterialTextureSlots[1].map_density = True vMaterialTextureSlots[1].map_density = True
vMaterialTextureSlots[1].rgb_to_intensity = True vMaterialTextureSlots[1].rgb_to_intensity = True
vMaterialTextureSlots[1].texture_coordinates = 'GLOBAL' vMaterialTextureSlots[1].texture_coordinates = 'GLOBAL'
pDensity.pointdensity.vertices_cache = 'WORLD_SPACE' pDensity.point_density.vertices_cache = 'WORLD_SPACE'
pDensity.pointdensity.turbulence = True pDensity.point_density.turbulence = True
pDensity.pointdensity.noise_basis = 'VORONOI_F2' pDensity.point_density.noise_basis = 'VORONOI_F2'
pDensity.pointdensity.turbulence_depth = 3 pDensity.point_density.turbulence_depth = 3
pDensity.use_color_ramp = True pDensity.use_color_ramp = True
pRamp = pDensity.color_ramp pRamp = pDensity.color_ramp
...@@ -562,7 +562,7 @@ class GenerateCloud(bpy.types.Operator): ...@@ -562,7 +562,7 @@ class GenerateCloud(bpy.types.Operator):
# of bounds. # of bounds.
cloudParticles.settings.amount = numParticles cloudParticles.settings.amount = numParticles
pDensity.pointdensity.radius = (.00013764 * volumeBoundBox + .3989) * pointDensityRadiusFactor pDensity.point_density.radius = (.00013764 * volumeBoundBox + .3989) * pointDensityRadiusFactor
# Set time to 1. # Set time to 1.
scene.frame_current = 1 scene.frame_current = 1
...@@ -612,8 +612,8 @@ class GenerateCloud(bpy.types.Operator): ...@@ -612,8 +612,8 @@ class GenerateCloud(bpy.types.Operator):
# Apply modifier # Apply modifier
bpy.ops.object.modifier_apply(apply_as='DATA', modifier=cldPntsModifiers[0].name) bpy.ops.object.modifier_apply(apply_as='DATA', modifier=cldPntsModifiers[0].name)
pDensity.pointdensity.point_source = 'OBJECT' pDensity.point_density.point_source = 'OBJECT'
pDensity.pointdensity.object = cloudPnts pDensity.point_density.object = cloudPnts
# Deselect All # Deselect All
bpy.ops.object.select_all(action='DESELECT') bpy.ops.object.select_all(action='DESELECT')
...@@ -629,22 +629,22 @@ class GenerateCloud(bpy.types.Operator): ...@@ -629,22 +629,22 @@ class GenerateCloud(bpy.types.Operator):
else: else:
pDensity.pointdensity.point_source = 'PARTICLE_SYSTEM' pDensity.point_density.point_source = 'PARTICLE_SYSTEM'
pDensity.pointdensity.object = cloud pDensity.point_density.object = cloud
pDensity.pointdensity.particle_system = cloudParticles pDensity.point_density.particle_system = cloudParticles
if scene.cloud_type == '1': # Cumulous if scene.cloud_type == '1': # Cumulous
print("Cumulous") print("Cumulous")
mVolume.density_scale = 2.22 mVolume.density_scale = 2.22
pDensity.pointdensity.turbulence_depth = 10 pDensity.point_density.turbulence_depth = 10
pDensity.pointdensity.turbulence_strength = 6.3 pDensity.point_density.turbulence_strength = 6.3
pDensity.pointdensity.turbulence_size = 2.9 pDensity.point_density.turbulence_size = 2.9
pRampElements[1].position = .606 pRampElements[1].position = .606
pDensity.pointdensity.radius = pDensity.pointdensity.radius + .1 pDensity.point_density.radius = pDensity.point_density.radius + .1
elif scene.cloud_type == '2': # Cirrus elif scene.cloud_type == '2': # Cirrus
print("Cirrus") print("Cirrus")
pDensity.pointdensity.turbulence_strength = 22 pDensity.point_density.turbulence_strength = 22
mVolume.transmission_color = [3.5, 3.5, 3.5] mVolume.transmission_color = [3.5, 3.5, 3.5]
mVolume.scattering = .13 mVolume.scattering = .13
......
...@@ -31,7 +31,7 @@ def getsizefrommesh(ob): ...@@ -31,7 +31,7 @@ def getsizefrommesh(ob):
def setupshards(context): def setupshards(context):
sce = context.scene sce = context.scene
#print(dir(context)) #print(dir(context))
#bpy.data.scenes[0].game_data.all_frames #bpy.data.scenes[0].game_settings.all_frames
tobeprocessed = [] tobeprocessed = []
for ob in sce.objects: for ob in sce.objects:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment