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
943de14e
Commit
943de14e
authored
13 years ago
by
Bartek Skorupa
Browse files
Options
Downloads
Patches
Plain Diff
changed convert_name(). Prevent errors in AE when user inputs invalid chars
parent
0c909c18
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io_export_after_effects.py
+18
-9
18 additions, 9 deletions
io_export_after_effects.py
with
18 additions
and
9 deletions
io_export_after_effects.py
+
18
−
9
View file @
943de14e
...
...
@@ -21,7 +21,7 @@ bl_info = {
'
name
'
:
'
Export: Adobe After Effects (.jsx)
'
,
'
description
'
:
'
Export selected cameras, objects & bundles to Adobe After Effects CS3 and above
'
,
'
author
'
:
'
Bartek Skorupa
'
,
'
version
'
:
(
0
,
5
5
),
'
version
'
:
(
0
,
5
6
),
'
blender
'
:
(
2
,
6
,
0
),
'
api
'
:
41098
,
'
location
'
:
'
File > Export > Adobe After Effects (.jsx)
'
,
...
...
@@ -69,10 +69,10 @@ def get_selected(context, prefix):
for
ob
in
obs
:
if
ob
.
type
==
'
CAMERA
'
:
cameras
.
append
(
ob
)
cams_names
.
append
(
convert_name
(
ob
,
prefix
))
cams_names
.
append
(
convert_name
(
False
,
ob
,
prefix
))
else
:
nulls
.
append
(
ob
)
nulls_names
.
append
(
convert_name
(
ob
,
prefix
))
nulls_names
.
append
(
convert_name
(
False
,
ob
,
prefix
))
selection
=
{
'
cameras
'
:
cameras
,
...
...
@@ -85,12 +85,20 @@ def get_selected(context, prefix):
# convert names of objects to avoid errors in AE. Add user specified prefix
def
convert_name
(
ob
,
prefix
):
ob_name
=
ob
.
name
for
c
in
(
"
"
,
"
.
"
,
"
,
"
,
"
-
"
,
"
=
"
,
"
+
"
,
"
*
"
):
ob_name
=
ob_name
.
replace
(
c
,
"
_
"
)
def
convert_name
(
is_comp
,
ob
,
prefix
):
if
is_comp
:
ob_name
=
ob
+
prefix
ob_name
=
ob_name
.
replace
(
'"'
,
"
_
"
)
else
:
ob_name
=
ob
.
name
+
prefix
if
ob_name
[
0
].
isdigit
():
ob_name
=
"
_
"
+
ob_name
ob_name
=
bpy
.
path
.
clean_name
(
ob_name
)
ob_name
=
ob_name
.
replace
(
"
-
"
,
"
_
"
)
return
prefix
+
ob_name
return
ob_name
# get object's blender's location and rotation and return AE's Position and Rotation/Orientation
...
...
@@ -320,7 +328,7 @@ def write_jsx_file(file, data, selection, export_bundles, comp_name, prefix):
#convert the position into AE space
ae_pos_rot
=
convert_pos_rot_matrix
(
matrix
,
data
[
'
width
'
],
data
[
'
height
'
],
data
[
'
aspect
'
],
x_rot_correction
=
False
)
#get the name of the tracker
name_ae
=
convert_name
(
track
,
prefix
)
name_ae
=
convert_name
(
False
,
track
,
prefix
)
#write JS script for this Bundle
jsx_file
.
write
(
'
var %s = newComp.layers.addNull();
\n
'
%
name_ae
)
jsx_file
.
write
(
'
%s.threeDLayer = true;
\n
'
%
name_ae
)
...
...
@@ -343,6 +351,7 @@ def write_jsx_file(file, data, selection, export_bundles, comp_name, prefix):
def
main
(
file
,
context
,
export_bundles
,
comp_name
,
prefix
):
data
=
get_comp_data
(
context
)
selection
=
get_selected
(
context
,
prefix
)
comp_name
=
convert_name
(
True
,
comp_name
,
""
)
write_jsx_file
(
file
,
data
,
selection
,
export_bundles
,
comp_name
,
prefix
)
print
(
"
\n
Export to After Effects Completed
"
)
return
{
'
FINISHED
'
}
...
...
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