PDA

View Full Version : C.O.F.F.E.E. - Textspline to single letters


eightyf
11-26-2006, 11:33 AM
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é

Per-Anders
11-30-2006, 07:58 PM
Hi, no the way you are doing this is the fastest/best way to do this.

eightyf
11-30-2006, 08:31 PM
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é

eightyf
12-01-2006, 10:00 PM
Splitting up the textspline by using the SetModelingCommand function doesn't seem to work when rendering... is that so?
Thanks
André

Per-Anders
12-01-2006, 11:02 PM
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.

eightyf
12-02-2006, 12:38 AM
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é

Per-Anders
12-02-2006, 12:44 AM
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.

eightyf
12-02-2006, 01:00 AM
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é

Per-Anders
12-02-2006, 02:51 AM
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.

eightyf
12-02-2006, 03:08 AM
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é

CGTalk Moderation
12-02-2006, 03:08 AM
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.