ATF integration with existing code, IColoringContext and IAnnotation

72 views
Skip to first unread message

David Jewsbury

unread,
Jan 27, 2016, 1:14:27 AM1/27/16
to Authoring Tools Framework

Hi!

First, I just wanted to say; thanks so much for releasing ATF open-source. I've been using it for about 6 months now, and it has been a huge benefit! It's become an important part of my project, so I wanted to drop a line.

Recently I've been integrating some existing code into the ATF framework. The existing code was a node diagram editor; so there is a little bit of overlap between the ATF circuit diagram editor. But I wanted to try to combine the best functionality from both ATF and our existing stuff.

And, actually, I've got to say I've been very happy with how easy it's been to selectively integrate parts of ATF and get it working with non-ATF controls and objects. I can see that there has been a lot of effort put into the design to make it flexible when working with different types, and to avoid pointing restrictions on client objects.

That's been great. I've been able to get our node editor working within an ATF application, and was able to seamlessly integrate ATF functionality for things like alignment controls, focus controls, hovering pop-ups and tree views -- all without changing the original code significantly.

There's a little bit of information about the project here:

You might be able to see from the screenshots that there's a lot of ATF functionality there, but also a lot of custom functionality. It all works very nicely together :).

But I hit a bit of snag with IColoringContext. At first it looks like it was going to be easy to integrate this with the default AnnotatingCommands object. However, I noticed that this object expects objects that the contents of ISelectionContext should implement IAnnotation. That seems to make sense, but actually IColoringContext doesn't use IAnnotation (it just uses plain "objects").

Our "node" objects are in a project that does not reference ATF, so can't implement IAnnotation. So I was wondering if this restriction in AnnotatingCommands was intended?

Cheers!

Ron AtSony

unread,
Jan 28, 2016, 2:13:03 PM1/28/16
to David Jewsbury, Authoring Tools Framework
Hi David,

Your XLE material editor looks great! Good job! Thanks for the nice feedback, too.

It appears that AnnotatingCommands was written with a very specific purpose in mind -- to let the user specify the foreground or background color of the text annotation objects. Or perhaps the person who wrote it imagined that there would be additional annotation-specific commands that could be added in the future.

As you've seen, there's nothing particularly annotation-specific about AnnotatingCommands and it looks like it could have been called ColoringCommands. It looks for selected objects that implement IAnnotation just so that the command can be enabled or disabled correctly. It probably would have been more useful and flexible for AnnotatingCommands to simply check if the IColorContext can actually color the selected object. I made the minor changes and tried them out and the Circuit Editor sample app can set the background color correctly of annotation objects (called Comments in the GUI). Please try out the attached file.

If you think my changes are useful, I can submit a pull request. Or you if you want to make further changes, you can submit a pull request.

I no longer work at Sony, but I still work with ATF at my current employer, Pocket Gems, in San Francisco. (We're hiring! We're looking for a graphics programmer on my tools team, too!)

--Ron


--
You received this message because you are subscribed to the Google Groups "Authoring Tools Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to authoring-tools-fr...@googlegroups.com.
Visit this group at https://groups.google.com/group/authoring-tools-framework.
For more options, visit https://groups.google.com/d/optout.

AnnotatingCommands.cs

David Jewsbury

unread,
Feb 1, 2016, 6:12:03 AM2/1/16
to Authoring Tools Framework, djew...@gmail.com
Ron,

Thanks for your quick reply. I'll try out your code and submit a pull request soon as soon as I can.

Ah, I see you changed jobs. Right after I send that previous message, I think I might read something about ATF going into maintenance mode at Sony. I hope it continues to grow with community additions, though.

It's seems rare to find large open-source projects specifically for the games industry. Other industries have really grasped that idea, but it still seems to be rare for us. It feels like the right time for it, though, right? Especially with smaller scale indie projects increasing in quality and quantity. I'd love to see more projects like ATF feeding into that industry.

Anyway, thanks & best of luck!


Ron2

unread,
Mar 30, 2016, 12:19:04 PM3/30/16
to Authoring Tools Framework, djew...@gmail.com
I went ahead and submitted a pull request for this change. If you ended up with a different solution, please comment on the pull request.

Thanks again and good luck with your endeavors, too!

--Ron
Reply all
Reply to author
Forward
0 new messages