2

I have a collection of some arbitrary shapes that I deform with Effect > 3D > Rotate. I want to apply a gradient to some of those shapes. The problem is that Illustrator, trying to preserve the 3d correctness, will rasterize and segment the gradient for each individual shape affected and when I export the project as svg, the svg will contain an actual image for every shape. Also it's extremely unoptimized and for lots shapes in a group, it takes a lot of time.

Is there a way to the make the gradient simply overlay?

The same effect I achieve manually by deforming the initial collection with the Free Transform Tool so that it matches the 3D Effect, but that is a destructive manipulation and I'd like to keep it procedural and work with the Appearance window. (In that line of though, can I save Free Transform manipulations as a preset?)

EDIT - added sample images

1) Initial image (length is 2182 characters): https://svgshare.com/i/7Qp.svg

2) 3D effect (length is 79394 characters): https://svgshare.com/i/7Rh.svg

3) Manual distort (length is 3358 characters): https://svgshare.com/i/7Po.svg

As you see, in (2) due to the rasterized gradient effect, size goes crazy.

  • An example image before and after transformation? – user120647 Jul 1 '18 at 14:48
  • @Danielillo I can recreate the problem and upload a sample .ai , but where? – hrs Jul 1 '18 at 14:50
  • I think will be enough if you put the original image, the 3D Rotate image and the Transformed Image, 3 jpg or png in the question. Or just one jpg with the three. – user120647 Jul 1 '18 at 14:51
  • @Danielillo updated OP with images – hrs Jul 1 '18 at 15:29
  • Answer updated with the transformation action – user120647 Jul 1 '18 at 16:18
2
  • To apply the same transformation to different shapes you can record an Action with all the transformation applied to the first shape and play this action to the others.

At the example, the action include the creation of a rectangle 310px x 310px, an applied Style for the colors and a Stop to type the text. After this stop, all the transform steps. At the end, the perspective effect made with an Envelope Distort. SVG length 4223 characters. Codepen.

transform action

With the same vectors but using just a gradient and a Clipping Mask with the three slanted squares as a Compound Shape, the final SVG is optimized to 3356 characters length. Codepen.

clipping mask

| improve this answer | |
  • Just tried it, it doesn't work for the Free Transform Tool, which has the ability to do perspective. – hrs Jul 1 '18 at 15:29
  • 1
    Answer updated with the perspective transform. – user120647 Jul 1 '18 at 17:36
0

Apply the 3D transformation effects using no shading: (Surface: no shading).

Expand and ungroup the result and apply gradients to individual shapes.

If you want to keep some of the auto-generated shadows then Copy your shape before applying effects.

Apply effects without shading, Paste in Place the shape and reapply the effects with shading.

Ungroup and Expand both results.

Delete the shaded sections where you want to use your custom gradients, or apply transparency settings to the auto shaded sections for interesting results.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.