Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Scripting info

  1. #1
    Join Date
    May 2002
    Location
    UK
    Posts
    295

    Default

    Hi all.

    There's a workaround in Draw that lets you apply a Blur to an object by working with drop shadows applied to transparent control objects.

    A script speeds this up. There's just one thing you cannot record, the ability to apply the control objects colour (before transparency was applied) to the drop shadow. The drop shadow will always default to black and must be filled seperately.

    Is it possible to add code to a script (using the script editor) that tells the script to apply a fill to the drop shadow colour well, that matches the original fill colour from the control object?

    Sark
    IP

  2. #2

    Default

    I know nothing about writing scripts, but this sounds interesting. Would be great if you could get working the way you described.
    So how about providing a link to your script?
    Also, how do you find Draw's performance with a large number of objects and effects? It seems to slow down noticeably with mine (CDR11). So using this method extensively would bog down the app, I think. Draw is an elephant compared to Xara. Sad, but true.
    IP

  3. #3
    Join Date
    May 2002
    Location
    UK
    Posts
    295

    Default

    Grafixman.

    Draws an elephant compared to everthing else available, which is why I still use CD9 after trying every upgrade that's been released.

    I'm using Win2K which I like too much to upgrade to XP, so maybe this has been part of my problem with recent versions?

    Having said all this, I use PhotoShop and recently decide to buy Illustrator (10). Having tried to get to grips with this for over a fortnight I have decide to sell it.

    Whatever you say about Draw, it is still the most user friendly vector app available. It's user interface is miles ahead of Illustrator. Some of Illustrators methods of doing things are just crazy.

    Node editing, colour application and the shape tools in Draw make Illustrators equivilents seem like rocket science.

    Anyway, the Drop shadow script.... I use the recorder to record the following steps.

    <span class="ev_code_RED">The following has been edited/amended to save duplicating in another post. </span>

    Draw a filled object (with the ellipse or rectangle tool) and then click the script recorders record button. Now, with the object selected, carry out the following steps...

    1...Select Transparency tool and choose Uniform from the drop down list. Set transparency slider to 100.

    2...Select Drop shadow tool and drag a short distance inside the object to create a drop shadow centred to the object. Set drop shadow opacity to 100.

    3...Right click Colour palettes “No colour well” to remove outline colour.

    4...Stop recording and name and save the script.

    If you now look in the Options dialogue, under Customise, the Toolbar and Menu options include a menu called Application Scripts. You can add this to the menu bar, or just add the script itself to an existing menu. Alternatively, a new toolbar button can be added.

    You can improve the speed of your script by editing it using the Script editor. For those running CorelDraw 9 (and possibly earlier/later versions). Select the newly created script in the Script recorder dialogue and click the small triangle to open a menu where you can select “Edit Debug Script”.

    With the Script editor open, copy the code below, delete the existing code, then Paste in the new code. Save and exit.

    <span class="ev_code_BLUE">REM Generated by DRAW's automation recorder
    REM Created On Saturday, December, 18, 2004 by Sark

    WITHOBJECT "CorelDraw.Automation.9"
    .StartOfRecording
    .ApplyUniformBitmapLens 100, 0, FALSE
    .ApplyDropShadow 0, 0, 100, 15, 1, FALSE
    .ApplyOutline 0, 0, 0, 0, 0, 0, 0, 0, 0, FALSE,
    .ConvertToCurves
    .EndOfRecording
    END WITHOBJECT
    </span>
    The above code is faster and converts object to curves.

    Sark

    PS...It’s not possible to save and reinstall individual scripts from my system due to the way the info is stored. I can’t even save them to my own systems Documents folder and then reinstall. Hence I can't upload the actual file.
    IP

  4. #4
    Join Date
    May 2002
    Location
    UK
    Posts
    295

    Default

    Grafixman said<BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Also, how do you find Draw's performance with a large number of objects and effects? It seems to slow down noticeably with mine (CDR11). So using this method extensively would bog down the app, I think. <HR></BLOCKQUOTE>
    Drop shadows can be resource hungry, but in Draw they behave in a strange way. Once you have created a drop shadow, you can duplicate it a large number of times without resources being eaten up. You can rotate and even scale a small amount without causing problems. After a while, changes have little affect on memory unless you shape edit, adjust feathering or scale up significantly. I’ve had over a hundred drop shadows on the page without hitting memory too hard.

    Problems occur when shape editing large drop shadows and when you have more than one drop shadow selected when scaling. If you group them before scaling, rotating etc, there’s no problem. You can have dozens grouped and scaling is almost immediate with little increase in memory usage. Grouping when scaling a large number of objects, drop shadows or otherwise helps enormously.

    Two other tricks to use if you want to work with a lot of drop shadows. Firstly, work on a zoomed document page, about 400% or so. This ensures the drop shadows, which are bitmaps, remain small. You can scale artwork up later (group first). Secondly, work with a lower drop shadow resolution and adjust back to the desired resolution after editing your artwork.

    To change the resolution (it defaults to 300DPI), go into Options, and under Document, General, change “Rendering resolution”. When you are finished working with drop shadows, change back to the desired resolution and scale the document a small amount (a fraction of a % is enough) to apply the new resolution.

    Sark
    IP

  5. #5

    Default

    Wow, great suggestions. I'm writing this down and sticking it on the monitor. You're right. I was essentially bogging down the file with lots of big 300 dpi bitmaps! Didn't realize that.
    Hope you find the solution for copying and pasting the object color to the shadow color. I got the script working and you're right. There should be a script workaround for the default shadow settings. Maybe Peter Clifton or some other script savvy Draw user would drop by and see this?
    IP

  6. #6

    Default

    Check out oberonplace for scripting info:

    http://www.oberonplace.com/tutor/index.htm

    navigation buttons at the bottom left and top left corners of the page.

    Object model glossary at

    http://www.oberonplace.com/vba/draw10vba.htm

    Sorry, but I can't help you with this. Way over my head.
    IP

  7. #7
    Join Date
    May 2002
    Location
    UK
    Posts
    295

    Default

    Grafixman

    Transparencies and lens effects also fall within this setting. When you consider your version can blend transparencies, you can appreciate the problems that will occur at the default 300DPI.

    Draws default setting are very poor. The undo is set to 99. Drop shadows and transparencies are controlled by vector objects and fall into this category, not the bitmap undo. 10 is the max you should really need. I personally work with just five and regularly hit the save button.

    My set up allows a rendering resolution of 72DPI and I work in such a way that the drop shadow resolution matches the screen resolution. This ensures clean bitmaps even when scaling down to true print size and smaller. Very much like you work in PP or Photoshop.

    Sark

    PS...Yes, I was hoping Peter Clifton might respond to the script question, as I'm sure this is achievable.
    IP

  8. #8
    Join Date
    May 2002
    Location
    UK
    Posts
    295

    Default

    WOW

    We appear to have posted within 1 minute of each other.

    http://www.talkgraphics.com/images/smilies/biggrin.gif http://www.talkgraphics.com/images/smilies/smile.gif http://www.talkgraphics.com/images/smilies/biggrin.gif

    Will check out the sites, but will probably be over my head as well.

    Sark
    IP

  9. #9

    Default

    Yeah, I came back to this page and here is your reply already. http://www.talkgraphics.com/images/smilies/biggrin.gif
    BTW I hope you are aware of the issues with dropshadows and printing:

    http://www.oberonplace.com/draw/tricks/halo.htm
    IP

  10. #10
    Join Date
    May 2002
    Location
    UK
    Posts
    295

    Default

    Yes, it's always wise to seperate bitmaps from there control objects or convert to bitmap.

    Some suggest converting the entire artwork to a bitmap before printing. Not sure how well that would work with fine outlines though.

    Sark
    IP

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •