Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
6b83cb96
Commit
6b83cb96
authored
14 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
updates for blender api changes
parent
1a45c5c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
io_import_scene_mhx.py
+10
-10
10 additions, 10 deletions
io_import_scene_mhx.py
object_cloud_gen.py
+15
-15
15 additions, 15 deletions
object_cloud_gen.py
object_fracture/fracture_setup.py
+1
-1
1 addition, 1 deletion
object_fracture/fracture_setup.py
with
26 additions
and
26 deletions
io_import_scene_mhx.py
+
10
−
10
View file @
6b83cb96
...
@@ -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
.
handle
1
=
(
float
(
args
[
2
]),
float
(
args
[
3
]))
pt
.
handle
_left
=
(
float
(
args
[
2
]),
float
(
args
[
3
]))
pt
.
handle
2
=
(
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
.
handle
1
=
eval
(
args
[
1
])
bez
.
handle
_left
=
eval
(
args
[
1
])
bez
.
handle
1
_type
=
args
[
2
]
bez
.
handle
_left
_type
=
args
[
2
]
bez
.
handle
2
=
eval
(
args
[
3
])
bez
.
handle
_right
=
eval
(
args
[
3
])
bez
.
handle
2
_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
.
connect
ed
:
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
'
)
...
...
This diff is collapsed.
Click to expand it.
object_cloud_gen.py
+
15
−
15
View file @
6b83cb96
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
object_fracture/fracture_setup.py
+
1
−
1
View file @
6b83cb96
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment