Apply Live Effect XML: the 3D effect.

Adobe Community Professional ,
Oct 06, 2018 Oct 06, 2018

Copy link to clipboard

Copied

I never thought it would come to this, but I finally am in a position to want to use the applyEffect(liveEffectXML) command to apply an Illustrator 3D effect!

While it is possible to obtain the info for the very basic effects through a non-compressed .ai file, the 3D effect string appears to be too insane for me to decipher.

/BasicFilter :

(Adobe 3D Effect) 1 0 /Filter ,

1 /Visible ,

(3D.aip) /PluginFileName ,

(3D Effect) /Title ,

/Dictionary : /NotRecorded ,

(3D Extrude & Bevel) /String (DisplayString) ,

0 /Bool (preserveSpots) ,

/FillStyle : 0 O

0 1 1 0 k

0 1 0 0 0 Xy

0 J 0 j 1 w 10 M []0 d

0 XR

0 1 Xd

/Def ;

(shadeColor) ,

0 /Int (revolveAxisMode) ,

1 /Real (mat_11) ,

0 /Int (numArtMaps) ,

1 /Int (numLights) ,

0 /Bool (invisibleGeo) ,

0 /Real (mat_23) ,

1 /Bool (revolveCap) ,

0 /Real (mat_01) ,

0 /Real (mat_03) ,

1 /Real (mat_33) ,

0 /Int (effectStyle) ,

0 /Real (revolveOffset) ,

0 /Bool (shadeMaps) ,

1 /Bool (extrudeCap) ,

1 /Bool (bevelExtentIn) ,

1 /Real (mat_00) ,

0 /Real (mat_10) ,

0 /Real (rotY) ,

40 /Real (surfaceMatte) ,

3 /Int (shadeMode) ,

8 /Real (bevelHeight) ,

0 /Real (mat_12) ,

10 /Real (surfaceGloss) ,

360 /Real (revolveAngle) ,

0 /Real (mat_31) ,

0 /Real (mat_21) ,

0 /Real (mat_13) ,

0 /Real (mat_30) ,

0 /Real (extrudeDepth) ,

25 /Real (blendSteps) ,

50 /Real (surfaceAmbient) ,

0 /Real (rotZ) ,

0 /Int (surfaceStyle) ,

2 /Int (3Dversion) ,

0 /Real (mat_20) ,

/Dictionary : /NotRecorded ,

1 /Real (lightIntensity) ,

0 /Real (lightPosY) ,

0.330000013113022 /Real (lightDirY) ,

-1 /Real (lightPosZ) ,

0 /Real (lightPosX) ,

0.389999985694885 /Real (lightDirX) ,

-0.850000023841858 /Real (lightDirZ) ,

; (light0) ,

X=

0 A

0 Xw

0 Ae

u

0 Ae

u

0 R

0 G

4 M

-7917.1968 7789.86426 m

-7907.0723 7799.98926 L

-7862.9277 7799.98926 L

-7852.8027 7789.86426 l

S

%_/ArtDictionary :

%_(1.570796) /String (BBAccumRotation) ,

%_;

%_

U

9 () XW

U

9 () XW

X+

(bevelArt) ,

0 /Real (mat_32) ,

1 /Real (mat_22) ,

0 /Real (rotX) ,

0 /Real (mat_02) ,

1 /Bool (paramsDictionaryInitialized) ,

0 /Real (cameraPerspective) ,

2 /Int (rotationPresetKey) ,

0 /Bool (showHiddenSurfaces) ,

; /Dict ;

/Part ,

Luckily I was able to dig out my old CS5 on another computer and get the FXG xml:

<ai:LiveEffect index="0" major="1" minor="0" name="Adobe 3D Effect">

  <ai:Dict data="R mat_10 0 R mat_00 1 R mat_33 1 R mat_03 0 R mat_01 0 R mat_23 0 R mat_11 1 R mat_02 0 R rotX 0 R mat_22 1 R mat_32 0 R mat_20 0 R rotZ 0 R mat_30 0 R mat_13 0 R mat_21 0 R mat_31 0 R mat_12 0 R rotY 0 I 3Dversion 2 I surfaceStyle 0 R surfaceAmbient 50 R blendSteps 25 R extrudeDepth 0 R revolveAngle 360 R surfaceGloss 10 R bevelHeight 8 I shadeMode 3 R surfaceMatte 40 B bevelExtentIn 1 B extrudeCap 1 B shadeMaps 0 R revolveOffset 0 I effectStyle 0 B revolveCap 1 B invisibleGeo 0 I numLights 1 I numArtMaps 0 I revolveAxisMode 0 B preserveSpots 0 B paramsDictionaryInitialized 1 B showHiddenSurfaces 0 I rotationPresetKey 2 R cameraPerspective 0 ">

    <ai:Entry name="light0" valueType="D">

      <ai:Dict data="R lightDirZ -0.85 R lightDirX 0.39 R lightPosX 0 R lightPosZ -1 R lightDirY 0.33 R lightPosY 0 R lightIntensity 1 "/>

    </ai:Entry>

    <ai:Entry name="bevelArt" valueType="D">

      <ai:Dict/>

    </ai:Entry>

    <ai:Entry name="shadeColor" valueType="F">

      <ai:Fill color="1 0 1 1 0"/>

    </ai:Entry>

    <ai:Entry name="DisplayString" value="3D Extrude & Bevel" valueType="S"/>

  </ai:Dict>

</ai:LiveEffect>

After taking all the "ai:" out of the thing it appeared to be good to go except it's not working like how I wish it would. It does almost everything but fails critically where I need it most. Specifically, it is not showing my bevel setting.

I really want that bevel be set to "classic".

Screen Shot 2018-10-06 at 2.20.41 PM.png

I want this

Screen Shot 2018-10-06 at 2.20.13 PM.png

But I keep getting this!

TOPICS
Scripting

Views

396

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 07, 2018 Oct 07, 2018

Copy link to clipboard

Copied

I give up, every road leads to dead ends.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 07, 2018 Oct 07, 2018

Copy link to clipboard

Copied

Maybe it's the one which is limited to a one-way trip.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 07, 2018 Oct 07, 2018

Copy link to clipboard

Copied

the setting's got to be stored in the document, I just can't pin point which one it is.

unless it is

2 /Int (3Dversion) ,

and it's just not working

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 07, 2018 Oct 07, 2018

Copy link to clipboard

Copied

Interestingly, I just noticed this - the 8pt cap height is actually being set - but just disabled. It seems that the only issue is that bevel setting. Maybe one day our children, or our children's children, will figure this mystery.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 04, 2021 Feb 04, 2021

Copy link to clipboard

Copied

LATEST

I wasn't able to solve the bevel issue, but just for anyone who comes across this post looking for 3D Live Effects: have a look at these: AI Live Effect Functions. The 3D effects work partially (the geometry seems to work well, except no bevel, and can handle only a single light). Not sure how you guys got the geometry to work, as I had to resort to using 3D matrix math to make it work (not my maths I should say—I used gl-mat4).

- Mark

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines