rulururu

post MergeDocument

June 29th, 2010

Filed under: COFFEE — xs_yann @ 13:45 67

How to merge two documents in COFFEE :

Example of use :

  1. MyMenuPlugin::Execute(doc)
  2. {
  3.         var file = new(Filename);
  4.         if (file->FileSelect("File to merge", FALSE) == FALSE)
  5.                 return FALSE;
  6.         MergeDocument(doc, file);
  7.         return TRUE;
  8. }
  9.  

The MergeDocument() code :

(more…)

post ContainerFile

June 29th, 2010

Filed under: COFFEE — xs_yann @ 13:38 60

ContainerFile is a class which allow to save and apply all object’s matrix of a hierarchy :

  1. class ContainerFile
  2. {
  3.         public:
  4.                 ContainerFile(name);
  5.                 Write(parent);
  6.                 Apply(parent);
  7. };
  8.  

Just include this file in your COFFEE code : container_file.coh

include "container_file.coh"

Here the saveread plugin to show how to use this class : saveread.cof

/!\ Update available
(more…)

post AddBitmapButton

June 29th, 2010

Filed under: COFFEE — xs_yann @ 13:21 47

How to add a bitmap button in a COFFEE interface :

[bool] AddBitmapButton([int] id, [GeDialog] dialog, [string] name, [int] flags);

Use like this :

  1. enum {
  2.         MY_BUTTON = 1000,
  3.         BITMAP_BUTTON,
  4.         _DUMMY_
  5. }
  6.  
  7. MyDialog::CreateLayout()
  8. {
  9.         SetTitle(PLUGIN_NAME);
  10.         AddButton(MY_BUTTON, BFV_FIT, 100, 15, "Dummy");
  11.         AddBitmapButton(BITMAP_BUTTON, this, "image.bmp", BFH_CENTER);
  12.         return TRUE;
  13. }
  14.  
  15. MyDialog::Command(id, msg)
  16. {
  17.         switch (id)
  18.         {
  19.                 case MY_BUTTON :
  20.                         println("Dummy button clicked");
  21.                 break;
  22.                 case BITMAP_BUTTON :
  23.                         println("Bitmap button clicked");
  24.                 break;
  25.         }
  26.         return TRUE;
  27. }

Just include this file in your COFFEE code : bitmap_button.coh

include "bitmap_button.coh"

(more…)

post AddBitmap

June 28th, 2010

Filed under: COFFEE — xs_yann @ 15:23 48

How to add a bitmap in a COFFEE interface :

[bool] AddBitmap([int] id, [GeDialog] dialog, [string] name, [int] flags);

Use like this :

  1. enum {
  2.         MY_BUTTON = 1000,
  3.         MY_BITMAP,
  4.         _DUMMY_
  5. }
  6.  
  7. MyDialog::CreateLayout()
  8. {
  9.         SetTitle(PLUGIN_NAME);
  10.         AddButton(MY_BUTTON, BFV_FIT, 100, 15, "Dummy");
  11.         AddBitmap(MY_BITMAP, this, "my_image.jpg", BFH_CENTER);
  12.         return TRUE;
  13. }

Just include this file in your COFFEE code : bitmap_gui.coh

include "bitmap_gui.coh"

(more…)

post Vector & Stack

June 24th, 2010

Filed under: COFFEE — xs_yann @ 20:42 55
  1. /*
  2. ** stack.coh
  3. **
  4. ** Made by yann koeth
  5. ** Wed Mar 31 15:55:55 2010
  6. */
  7.  
  8. class Stack
  9. {
  10.         private:
  11.                 var data;
  12.                 var next;
  13.                 var count;
  14.         public:
  15.                 Stack();
  16.                 Push(data);
  17.                 GetNext();
  18.                 GetCount();
  19.                 GetArray();
  20. };
  21.  
  22. Stack::Stack()
  23. {
  24.         next = NULL;
  25.         count = 0;
  26. }
  27.  
  28. Stack::Push(data)
  29. {
  30.         var ne = new(Stack);
  31.         ne->data = data;
  32.         ne->next = this;
  33.         ne->count = ++this->count;
  34.         this = ne;
  35.         return (this);
  36. }
  37.  
  38. Stack::GetNext()
  39. {
  40.         return (next);
  41. }
  42.  
  43. Stack::GetCount()
  44. {
  45.         return (count);
  46. }
  47.  
  48. Stack::GetArray()
  49. {
  50.         var arr = new(array, count + 1);
  51.         var i, stack;
  52.         for (i = 0, stack = this; i < count && stack; i++, stack = stack->next)
  53.                 arr[i] = stack->data;
  54.         arr[i] = NULL;
  55.         return (arr);
  56. }

Download stack.coh

  1. /*
  2. ** StdVector.coh
  3. **
  4. ** Made by yann koeth
  5. ** Wed Mar 31 15:55:55 2010
  6. */
  7.  
  8. class StdVector
  9. {
  10.         private:
  11.                 var arr;
  12.                 var len;
  13.         public:
  14.                 StdVector();
  15.                 Size();
  16.                 PushBack(value);
  17.                 PushFront(value);
  18.                 At(i);
  19. };
  20.  
  21. StdVector::StdVector()
  22. {
  23.         arr = new(array, 0);
  24.         len = 0;
  25. }
  26.  
  27. StdVector::Size()
  28. {
  29.         return len;
  30. }
  31.  
  32. StdVector::PushBack(value)
  33. {
  34.         var tmp = arr;
  35.         arr = new(array, len + 1);
  36.         var size = sizeof(tmp);
  37.         var i;
  38.         for (i = 0; i < size; i++)
  39.                 arr[i] = tmp[i];
  40.         arr[size] = value;
  41.         len++;
  42. }
  43.  
  44. StdVector::PushFront(value)
  45. {
  46.         var tmp = arr;
  47.         arr = new(array, len + 1);
  48.         arr[0] = value;
  49.         var size = sizeof(tmp);
  50.         var i;
  51.         for(i=0; i<size; i++)
  52.                 arr[i+1] = tmp[i];
  53.         len++;
  54. }
  55.  
  56. StdVector::At(i)
  57. {
  58.         if (i < sizeof(arr))
  59.                 return arr[i];
  60.         else
  61.                 return NULL;
  62. }

Dowload stdvector.coh

post xsXRefUpdate

June 24th, 2010

Filed under: COFFEE, Cinema 4D Plugins — xs_yann @ 20:25 64

Ceci est un plugin COFFEE pour Cinema 4D qui permet de mettre à jour les références de XRefs.

This is a COFFEE plugin for Cinema 4D that can update XRefs references.

Example :
XRef = object_02.c4d
Folder :
– object1.c4d
– object_02.c4d
– object-4.c4d
– object006.c4d

Le plugin va mettre à jour object_02.c4d en object006.c4d (le plus récent).
The plugin will update object_02.c4d into object006.c4d (the most recent).

Download xsXRefUpdate

post SMC 122

June 24th, 2010

Filed under: 3D, SMC — xs_yann @ 19:50 53

Spatial Conquest :

smc122

post SMC 130

June 24th, 2010

Filed under: 3D, SMC — xs_yann @ 19:49 51

Boats :

smc130

post Table

June 24th, 2010

Filed under: 3D — xs_yann @ 19:46 52

table_stoch

post Logo

June 24th, 2010

Filed under: 3D — xs_yann @ 19:44 70

dir

dir1

Next Page »
ruldrurd
© xs yann