C.O.F.F.E.E. - Textspline to single letters

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  11 November 2006
C.O.F.F.E.E. - Textspline to single letters?

Hi,
for a coffee script I am working on, I need to split a text spline into single letters. I didn't find another solution than to do the following:
- create a copy of the textspline.
- convert the textspline (option "single letters" enabled") into splines.
- Get position of each letter and create single letter-textsplines.
I guess there must be an easier way, but I cannot find it.
Of course, I could just create single text-spline objects, but the spacing wouldn't be the same and since I cannot get the size (not SCALE) of the spline, all of the letters would have the same width. I.e. The distance from "I" to "W" would be the same as the distance from "I" to "I"...
Any help would greatly be appreciated.
Thank you
André

Last edited by eightyf : 11 November 2006 at 05:47 PM.
 
  11 November 2006
Hi, no the way you are doing this is the fastest/best way to do this.
__________________
The Third Party | Homepage | My Reel
"You need to know what you're doing before you start, and to start because you need what you're doing."
 
  11 November 2006
Originally Posted by Per-Anders: Hi, no the way you are doing this is the fastest/best way to do this.

Really? That really comes as a surprise. I thought that splitting up textsplines would be an often used function and I just didn't find it in the SDK.
Thank you very much for your reply.
Regards
André
 
  12 December 2006
Just another question

Splitting up the textspline by using the SetModelingCommand function doesn't seem to work when rendering... is that so?
Thanks
André
 
  12 December 2006
A scene sent to the renderer contains only the geometry that will be visible in the render engine, splines etc aren't rendered and so don't exist inside of the render engine's document.
__________________
The Third Party | Homepage | My Reel
"You need to know what you're doing before you start, and to start because you need what you're doing."
 
  12 December 2006
Aha...

Sooooo, how could I gather the information, where the single letters are? I surely don't want to render those help typos, but is there a way to make the render engine at least "notices" their existence? Dunno... by putting them into a extrude nurb or something like that???
Sounded (and looked) so easy when I started **sigh**
Thanks
André
 
  12 December 2006
You'd run your command outside of the render document in the general scene document instead then pass that data to your plugin as it needs it.
__________________
The Third Party | Homepage | My Reel
"You need to know what you're doing before you start, and to start because you need what you're doing."
 
  12 December 2006
Sorry...

I really apologize for being so dumb and this is really getting embarassing... but.. how could I do that? Where can I place a command in the general scene document (never heard that one before). Would this mean to include an external script file which is not in the render pipeline?
I hate people who want a tutorial for everything but....
If I want to read out the position of a specific letter of a textspline (to which the coffe-later-to-be-a-simple-plugin-tag is attached) how is this made?
To split up the textspline I use the SendModellingCommand(MCOMMAND_MAKEEDITABLE...) which produces an null object with the single letters as childs. Those are - if I understand you correctly - not recognized by the renderer. But if I - somehow - place this command outside of my active document, how is the data retrieved?
Sorry again for the silly questions.
André
 
  12 December 2006
It's been so long since I used COFFEE for this sort of thing i'm not sure how you'd go about it at rendertime. The currently active document can be got via GetActiveDocument(), this isn't hte same as the doc in the main(doc, op) { ... } function as that can be the renderdocument, while getactivedocument will never be a render document, only the one the user is currently editing in. with that you could potentially get your spline letters positions from that way, another thing you might just be able to get away with is generating the spline object, then doing a current state to object on it without even putting it into any document at all. the only issue with using GetActiveDocument() is that it could potentially be dangerous during a render (as the user is busy editing that document while the render is doing what it does on it's own seperate copy altogether), so it's probably not recommended, however it can be worth trying as a possibility.
__________________
The Third Party | Homepage | My Reel
"You need to know what you're doing before you start, and to start because you need what you're doing."
 
  12 December 2006
Step by step

Thank you so much for taking time for this.
Your idea with the General Scene Document lead me to the approach of creating a new Basedocument, where the SendModelingCommand-Objects are stored in. This seems to work like charm. Never would've even thought of doing it this way.
Needless to say, that there are many other problems ;-)
Thanks again, you've helped me a lot!
André
 
  12 December 2006
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:49 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.