DescEdit (Descriptionfiles Editor)
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2011 at 09:36, xxxxxxxx wrote:
Unfortunately it's not loaded into the c4d module.
Would also be fatal.Yes, of course you can post it here, too.
But I con't have the time now. Will test it tomorrow.
Cheers, -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 31/05/2011 at 10:35, xxxxxxxx wrote:
I took a look through my Coffee stuff to see if I had anything using LoadDialogResource().
And I found one example:MyDialog::CreateLayout() //This creates the dialog gizmos using an external .res file { var resources = LoadDialogResource(IDD_DIALOG_MyDialog, plugin_resources,BFH_SCALEFIT | BFV_SCALEFIT); // Loads the gizmo descriptions from a .res file return resources; }
"IDD_DIALOG_MyDialog" is the name of the .res file located in my res folder.
I don't know if that will help you with your python project or not.
But it's the only example I have.Here's my custom gui code that I copied from your video:
import c4d from c4d import gui def isIterateable(item) : try: item[0] except: return False else: return True class ListViewData: def __init__(self, iterateableData) : if not isIterateable(iterateableData) : raise TypeError, "%s must be initialized with an iterateable value" %self.__class__.__name__ self.data = iterateableData def GetColumn(self, index) : if index > len(self.data) : return else: return self.data[index] def GetLengthOfData(self) : return len(self.data) class MyUA(gui.GeUserArea) : colors = { "background": c4d.Vector(.2), "lighter": c4d.Vector(.6), "darker": c4d.Vector(.8, .4, .2), "marked": c4d.Vector(.2), "text": c4d.Vector(.1), "markedText": c4d.Vector(.7, .5, .6), } def __init__(self, rowheight, data, columnwidth = (100, )) : if not isIterateable(data) : raise TypeError, "%s must be initialized with an iterateable value" %self.__class__.__name__ self.minimumHeight = rowheight * len(data) self.rowheight = rowheight self.columnwidth = columnwidth self.data = data self.marked = 2 def DrawMsg(self, x1, y1, x2, y2, msg) : #Set Background Color self.DrawSetPen(self.colors["background"]) self.DrawRectangle(x1, y1, x2, y2) rHeight = self.rowheight #Draw lighter areas self.DrawSetPen(self.colors["lighter"]) for i in xrange(0, len(self.data), 2) : if i == self.marked: self.DrawSetPen(self.colors["marked"]) self.DrawRectangle(x1=0, y1 = rHeight*i, x2=x2, y2 = rHeight * (i+1)) if i == self.marked: self.DrawSetPen(self.colors["lighter"]) #Draw darker areas self.DrawSetPen(self.colors["darker"]) for i in xrange(0, len(self.data), 2) : if i == self.marked: self.DrawSetPen(self.colors["marked"]) self.DrawRectangle(x1=0, y1 = rHeight*i, x2=x2, y2 = rHeight * (i+1)) if i == self.marked: self.DrawSetPen(self.colors["darker"]) #Draw self.data self.DrawSetPen(self.colors["text"]) for i in xrange(len(self.data)) : if i == self.marked: self.DrawSetPen(self.colors["markedText"]) for j in xrange(self.data[i].GetLengthOfData()) : if j >= len(self.columnwidth) : width = self.columnwidth[-1] else: width = self.columnwidth[j] itemToDraw = str(self.data[i].GetColumn(j)) self.DrawText(itemToDraw, x1 = x1 + j*width, y1 = i * rHeight + int((rHeight * .1))) if i == self.marked: self.DrawSetPen(self.colors["text"]) def GetMinimumHeight(self) : return 200, self.minimumHeight() def InputEven(self, msg) : #x = msg(c4d.BFM_INPUT_X) y = msg(c4d.BFM_INPUT_Y) self.marked = int(y/self.rowheight) self.ReDraw() return True class dlg(gui.GeDialog) : def Init(self) : pass def CreateLayout(self) : self.ua = MyUA(15, [ListViewData(("Name", "hello", 1002)) for i in range(20)]) ua_id = self.AddUserArea(100000121, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT) self.AttachUserArea(self.ua, ua_id) return True d = dlg() d.Open(c4d.DLG_TYPE_MODAL_RESIZEABLE, 1000124, -1, -1, 400, 300)
There are no errors.
But I don't get any text values. It's just black.-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/06/2011 at 08:35, xxxxxxxx wrote:
First of all, please post such huge Code's on services like Pastebin.com.
Then, take a look at your idnentation.GetMinimumHeight() and InputEven() are intendet a space to much.
Also, it should be called InputEven t.
Please use 4-space indentation. It makes the code much more cleaner and overviewable.
Many editors support replacing automatically with a number of spaces, in Python's case it should be 4.In InputEvent you wanted to call the container, instead of use __getitem__ .
y = msg(c4d.BFM_INPUT_Y) -> y = msg[c4d.BFM_INPUT_Y]You donÄt get any text, because the 2nd for-loop after the commend "Draw self.data" is wrong intended.
for i in xrange(len(self.data)) : if i == self.marked: self.DrawSetPen(self.colors["markedText"]) for j in xrange(self.data[i].GetLengthOfData()) : if j >= len(self.columnwidth) : width = self.columnwidth[-1] else: width = self.columnwidth[j]
should be
for i in xrange(len(self.data)) : if i == self.marked: self.DrawSetPen(self.colors["markedText"]) for j in xrange(self.data[i].GetLengthOfData()) : if j >= len(self.columnwidth) : width = self.columnwidth[-1] else: width = self.columnwidth[j]
Next, you don't see any coloured lines,because the drawing-clause is wrong intended.
#Draw lighter areas self.DrawSetPen(self.colors["lighter"]) for i in xrange(0, len(self.data), 2) : if i == self.marked: self.DrawSetPen(self.colors["marked"]) self.DrawRectangle(x1=0, y1 = rHeight*i, x2=x2, y2 = rHeight * (i+1)) if i == self.marked: self.DrawSetPen(self.colors["lighter"])
should be
#Draw lighter areas self.DrawSetPen(self.colors["lighter"]) for i in xrange(0, len(self.data), 2) : if i == self.marked: self.DrawSetPen(self.colors["marked"]) self.DrawRectangle(x1=0, y1 = rHeight*i, x2=x2, y2 = rHeight * (i+1)) if i == self.marked: self.DrawSetPen(self.colors["lighter"])
While drawing the Darker areas, you chose a wrong startingvalue within the xrange function.
It should be 1, not 0 like when drawing the lighter areas.#Draw darker areas self.DrawSetPen(self.colors["darker"]) for i in xrange(0, len(self.data), 2) : pass
should be
#Draw darker areas self.DrawSetPen(self.colors["darker"]) for i in xrange(1, len(self.data), 2) :
Now it should work.
You also messed up the colors.colors = { "background": c4d.Vector(.2), "lighter": c4d.Vector(.6), "darker": c4d.Vector(.8, .4, .2), "marked": c4d.Vector(.2), "text": c4d.Vector(.1), "markedText": c4d.Vector(.7, .5, .6), }
should be
colors = { "background": c4d.Vector(.2), "lighter": c4d.Vector(.6), "darker": c4d.Vector(.2), "marked": c4d.Vector(.8, .4, .2), "text": c4d.Vector(.1), "markedText": c4d.Vector(.7, .5, .6), }
The full working code is here.
cheers
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/06/2011 at 08:59, xxxxxxxx wrote:
It was rather difficult to copy the code from your video. It's a long one.
Thanks for posting the code.Now I just need to go through it and see If I can figure out how it all works.
Then try to do it in C++.Thanks,
-ScottA -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/06/2011 at 01:32, xxxxxxxx wrote:
Np.
A preview of the Description Editor.
There are still many bugs. It's just that you can see what it will look like.
Cheers, -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/06/2011 at 06:28, xxxxxxxx wrote:
I didn't want to make the whole video again, only because at the end of all an error occures because of a missing import in the DescEdit Example Object.
But instead of that, everything worked fine.
Give me some feedback, please.DescEdit Example - The first step to the output
Cheers,
Niklas -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/06/2011 at 12:56, xxxxxxxx wrote:
Hi Niklas,
I've had a look at the video now. It's coming along nicely. It looks as though you've finished the basic code for writing the various files in the correct format - which would be a real timesaver in itself.
It's still not as user-friendly as I'm sure you're intending to make it. For example, when defining the container object, why not have a drop-down list of possible includes rather than typing it in? Or, for a REAL element, you could let the user choose various options from a list, like the unit to be used.
But I'm sure you're working on all that, so carry on and I think a lot of us would use the final version.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 04/06/2011 at 20:03, xxxxxxxx wrote:
Thanks spedler !
I first want to make it wokr in generall. Fine things can be added later.The GUI now has been finished! After rewriting the whole ...
Here's the latest preview! (With me speaking, don't laugh about my englisch )I now have to work over ther DescFile Generation Process once again, because it's less comfortable than I had imagined.
Any Idea how i coul implement reopening of the files ?
I don't want to write a ressource-parser O.o
I'm thinking about my own Project fileformat for this.Cheers,
Niklas//EDIT
DOOH ! I forgot to implement Groups under Groups !! :OO
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/06/2011 at 01:49, xxxxxxxx wrote:
Looking pretty good. I've no other comments about the GUI to add to my previous ones.
WRT to saving/loading your files, I think this depends on how you've structured the data you have for the resource. The resource is basically a linked list so you need some way to handle child elements, siblings, and so on. Presumably you already do this - did you subclass GeListNode or something?
If your data is structured like that then could you save it out as a binary file, just saving each element in turn? That would make it much easier to reload it.
BTW, your English is excellent. No one's going to laugh.
Steve
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/06/2011 at 07:05, xxxxxxxx wrote:
Thank you.
No, i didn't subclass GeListNode. (Is this possible ?)
I have classes for Group, Element, Cycle and CycleId
Group, Element and Cycle hold an list called subelements.
In the list can be again Groups, Elements, etc.
The output formatting is done recursively.Do you mean a file for every element ?
Thanks.
Ehm, do ou think one would really need the ID Parameter for an Element ?
Maybe it's not that important to be able to define some IDs yourself.Niklas
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/06/2011 at 08:02, xxxxxxxx wrote:
I forgot you're writing in Python. In C++ it seemed to me that you could create a class based on an existing SDK class (purely for convenience - you could create your own instead) and use that to hold details of the various elements in the description. In Python you've got lists and tuples and things which make life a lot easier when managing lists of objects.
No, I didn't mean one file per element. I thought that you could create a file whose first parameter would hold the number of elements in the resource. Then you would save each data structure representing an element to the file, one after the other. On reloading you would just reload the required number of data structures.
However, to recreate the resource each element would have to point to its first child element (if any) and to its first sibling element. That's why I thought a linked list would be a handy way to manage the various elements, and since the SDK contains a class which is a linked list, you could maybe subclass that. But I don't know how it would work in Python using its built-in lists.
Anyway, just some thoughts.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/06/2011 at 10:32, xxxxxxxx wrote:
Thanks for the suggestions.
I came to the conclusion that it would be easier to have an own fileformat.I've completed the raw code (that I have to rewrite next time because right now it is just holy crap !).
Best thing is that the chunksize is variable so the filessize won't bee tooooo large.
This is the raw file text.
I'm able to analyze this text. I will now implement recursive generation of the objects for the dialog.There are only a few bugs with the FileFormat formatting, i'll get them fixed too !
Cheers,
Niklas -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/06/2011 at 09:02, xxxxxxxx wrote:
Hei Guys !
I am proud to be able to tell you that Description Editor is almost finished !Here is just another Example to see it in action !
(I'm sorry for my speed with the mouse . Hope you get what's going on on the screen o.o )I hope you like it !
Cheers,
Niklas -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/06/2011 at 11:08, xxxxxxxx wrote:
Looking interesting. Hard to see what's what in the video due to the scale. Any chance of some higher-res screen shots to see the various interfaces?
Like your desktop, btw!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/06/2011 at 11:52, xxxxxxxx wrote:
Are you not able to view it in Full Hd ? :0
But I will make clearer and more overviewable video when it has finished.
Thanks
Unfortunately I didn't create the wallpaper myself. Copyright by NVidia ^^
(Don't want to show off with things that are done by others) -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/06/2011 at 12:25, xxxxxxxx wrote:
Didn't expect that making it full screen would be crispy clear. Must be the scaling down at screenr that makes the quality look blurry at the default size (non-full screen). Much better now.
What do use for your video screen capture (as I'm looking around for something on Windows 7 64-bit that works)?
Thanks,
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/06/2011 at 12:37, xxxxxxxx wrote:
Niklas, to me your work looks fantastic. I don't get the complete
picture yet what's happening or what can be done or not.
Does this mean we can make DropCycle buttons to be used in Python plugin expressions?Cheers
Lennart -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/06/2011 at 13:13, xxxxxxxx wrote:
@kuro:
I'm using ScreenR for short things. (up to 5 minutes are possible with free account)
I have searched another software today.
I found CamtasiaStudio FREE (search with google, it is Open Source).
It works very nice.
//Edit: It is called CamStudio, sorry@tca:
Thank you !
You will see as I made a complete video of it.
What do you mean with DropCycle ? Something like the "Projection"- Element you can find in a Texturetag Description ?Cheers,
Niklas -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/06/2011 at 13:30, xxxxxxxx wrote:
I mean what you get when using Userdata and select: Integer -> Cycle.
There you can type your setting names and ID's like:
0; First
1; Second;
2; Blue
3; nuxRoxs
etc...You then get a "dropdown" button to select any of the entries.
Cheers
Lennart -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/06/2011 at 13:43, xxxxxxxx wrote:
This is already possible.
And DescEdit does support it !LONG TEXTURETAG_PROJECTION { CYCLE { TEXTURETAG_PROJECTION_CUBIC; TEXTURETAG_PROJECTION_SPHERICAL; } }
Just as an Example.
Haha, thanks, I'm feeling flattered :'D
Cheers,