Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. WickedP
    3. Posts
    • Profile
    • Following 0
    • Followers 0
    • Topics 35
    • Posts 95
    • Best 6
    • Controversial 0
    • Groups 0

    Posts made by WickedP

    • RE: CAMERA_ZOOM and Pparallel

      Thanks @ferdinand, this seems to have solved my problem.

      Apologies if it came across a bit abrupt, I was trying to get to the crux of it. Just seemed strange that there wasn't a way to rationally relate the zoom to any meaningful size for an orthographic camera. In other software I recall being able to set the camera as a width and height, not some factor of zoom. Made much more sense, kind of like setting it as a size. Also curious to know why they choose 1024 to underpin the zoom and not a rounded number, like 1000 (or something that can work off C4D's base unit).

      But all good here - it's working now. Solved.

      WP.

      posted in Cinema 4D SDK
      WickedPW
      WickedP
    • CAMERA_ZOOM and Pparallel

      Hi Folks,

      How does the camera zoom work with Pparallel? It feels really unituitive without knowing what the number means. How can I set the 'zoom' so that it covers a particular unit area of the viewport?

      As an example, if I have an object - say a plane that's width and height are the same in units as HD resolution (so width 1920 and height 1080), how can I set the 'zoom' so that the parallel camera covers the precise width (or height) of the plane (assume everything lines up)?

      This viewport capture might help to visualise:

      7046624e-e3be-47d5-bff7-6c7313b5bb04-image.png

      I want to know what 'zoom' means in terms of viewport unit size, so that I can set the 'zoom' to a size that reflects an object unit size in the scene.

      WP.

      posted in Cinema 4D SDK c++
      WickedPW
      WickedP
    • RE: Dynamic desription issue

      Thanks Ferdinand, I thought it was something like that, but wasn't completely sure. Seems I should keep a count perhaps and just override any previously existing one with a default container again.

      Cheers,

      WP.

      posted in Cinema 4D SDK
      WickedPW
      WickedP
    • Dynamic desription issue

      Hi Folks,

      I've stumped myself. I have a dynamic GetDDescription in an object plugin, which adds some customgui descriptions (customguidata is a BaseContainer, my own registered one). The display works fine and the data is saved/loaded etc with the object.

      I want to remove one of the containers, but bc->RemoveData(id) returns false (as does bc->RemoveIndex(index)). Are we not able to remove data from the underlying container?

      Sudo code:

      BaseNode *node = Get();
      BaseObject *op........
      BaseContainer *bc = op->GetDataInstance();
      if(bc->GetContainerInstance(id) != nullptr)    <-- passes
      {
          bc->RemoveData(id);    <-- returns false
          /* Check container again */
          if(bc->GetContainerInstance(id) != nullptr)    <-- fails
      }
      // The customgui is removed from the AM.
      // Add new item, container reappears along with new one.
      

      Apologies for the lack of code - but it's pretty much as is above. Can someone open my eyes on this?

      Cheers,

      WP.

      posted in Cinema 4D SDK c++
      WickedPW
      WickedP
    • RE: GUI Bitmap Button Properties

      Hi @merkvilson

      This may not help, I'm not a python coder, but for the padding, it might be worth trying to set the BITMAPBUTTON_NOBORDERDRAW flag. I can't tell from the screen shot if that's happening here, but it might be the button border? See if that helps.

      I'll let others help you with your other queries.

      WP.

      posted in Cinema 4D SDK
      WickedPW
      WickedP
    • RE: Getting font file/directory

      Hi @m_adam,

      No probs. I can work without it.

      I'm more after the font file, I only mentioned the directory thinking it might help.

      I'm using a library to help with draw functions for a user interface, and I'd like to set the font to the same as Cinema's so there's consistency in the look. The library allows you to set a font via a path to the font file.

      Perhaps if the fonts data container could include a Filename/String to the file itself in future? Just a thought.

      Cheers,

      WP.

      posted in Cinema 4D SDK
      WickedPW
      WickedP
    • Getting font file/directory

      Hi Folks,

      Is there a way to get the font file/directory that Cinema4D uses? I can't see how to in the SDK.

      Would like it because I'm leveraging a library that takes a font file as an input, and I'd like to pass it the same as Cinema's in an effort to try and keep the look of the draws as close to C4D as possible, for consistency.

      7956c39a-07d8-402b-913f-d18e3a72d6ff-image.png

      WP.

      posted in Cinema 4D SDK c++
      WickedPW
      WickedP
    • RE: Sub-frame document time

      Is there any way to get around the apparent hard-coded maximum frame rate limit?

      WP.

      posted in Cinema 4D SDK
      WickedPW
      WickedP
    • Sub-frame document time

      Hi folks,

      I have a document in memory and I need to evaluate data to a sub-frame time value. The issue I'm getting is that when I do this:

      BaseTime time = doc->GetTime();
      // adjust time numerator here
      doc->SetTime(time);
      //SetDocumentTime(doc,time);
      doc->ExecutePasses(...);
      

      the document time is floored to the nearest frame, and does not take on the sub-frame value. I can see this, because straight after I execute the document and pull the time again, it's reverted back to the original floored frame. I can however, change to the next full frame.

      I've tried other methods like SetDocumentTime() to no avail.

      Is there a trick I'm missing to this?

      WP.

      posted in Cinema 4D SDK c++ windows
      WickedPW
      WickedP
    • RE: Converting image bit depth

      Thanks @ferdinand,

      Conversion is in memory only. I may output at a later stage, though I do save using BaseBitmap->Save() for those times.

      This episode turned out to be quite more than I bargained for in the end. Had to make some serious project changes. But I do believe I've now solved my image problems (albeit, for now!).

      WP.

      posted in Cinema 4D SDK
      WickedPW
      WickedP
    • Converting image bit depth

      Hi Folks,

      I need to transfer some images into different bit depths (mainly 8 and 32-bits). I see inside Cinema4D there's a few commands for these, such as ID 170657 and ID 170659.

      Is it possible to use these in code, for example, to convert an 8-bit to 32-bit? If so, how?

      WP.

      posted in Cinema 4D SDK c++
      WickedPW
      WickedP
    • RE: BFM_DRAGRECEIVE

      Thanks @m_adam,

      I had to jump through a bunch of hoops with this one, because I put the queue process into a progress dialog so that for large file arrays there's an indicator of progress. Otherwise it just appears to hang and the user won't know why. But this made it tricky when the timer is also used because of the different thread contexts involved with the timer, the progress dialog and everything else on the main thread. But with a bit of care, it seems to work.

      Thanks again,

      WP.

      posted in Cinema 4D SDK
      WickedPW
      WickedP
    • BFM_DRAGRECEIVE

      Hi folks,

      is it possible to get the number of files in a drag operation, before the execution of each one individually?

      case BFM_DRAGRECEIVE:
      {
      	KillEvents();
      
      	if(msg.GetData(BFM_DRAG_FINISHED).GetBool())
      	{
      		/* Custom handle function */
      		Handle_FileDrag(msg);
      	}
      
      	return SetDragDestination(MOUSE_NORMAL);
      }
      

      I'm currently getting multiple executions for a single drop. This isn't too much of an issue for a dozen or so files, but I'm concerned about many hundreds to 10's of thousands. The main issue is that I have to do a redraw for this operation. Is there a way around this?

      WP.

      posted in Cinema 4D SDK sdk c++
      WickedPW
      WickedP
    • RE: ShowBitmap() and image name

      @ferdinand, By the way, just a small forum issue I'm seeing, I noticed my 'Mark as solved' doesn't look right in the menu. Don't know if it's just me or if the css might need some attention?

      1ebc9c69-f3f7-47c0-b13f-bb5a184c9f58-image.png

      Thanks again.

      WP.

      posted in Cinema 4D SDK
      WickedPW
      WickedP
    • RE: ShowBitmap() and image name

      Hi @ferdinand,

      I seem to have something working with the lib_pictureviewer.h library. Thanks for this. Maybe in future the standard ShowBitmap() could have a default empty string argument with it. Just a thought.

      Thanks again,

      WP.

      posted in Cinema 4D SDK
      WickedPW
      WickedP
    • ShowBitmap() and image name

      Hi folks,

      How do I set a name for an image sent to the picture viewer? This bit here:

      93084c00-cd80-473f-96e0-6d0be847f487-image.png

      I tried setting the bitmap data like this:

      bmp->SetData(BASEBITMAP_DATA_NAME,"My name");
      ShowBitmap(bmp);
      

      but it does nothing.

      WP.

      posted in Cinema 4D SDK sdk c++
      WickedPW
      WickedP
    • RE: ProgressDialog and SetTitle()

      Hi @i_mazlov

      The dialog/gui is open. It's a progress dialog that I use to run an export function.

      I did some more digging, and I believe I've solved it. I had to put the SetTitle() into the dialog's Timer() function. So, something like this:

      virtual void MyProgressDialog::Timer(const BaseContainer& msg)
      {
          // 'title' is a class-level string variable
          SetTitle(title);
      
          return ProgressDialog::Timer(msg);
      }
      

      Seems to work as expected.

      WP.

      posted in Cinema 4D SDK
      WickedPW
      WickedP
    • ProgressDialog and SetTitle()

      Hi folks,

      is it possible to update a ProgressDialog's title inside the Main() function? I'm wanting to make the title "x of y complete". Doing this doesn't work:

      // pseudo code
      .. Main()
      {
      SetPercent(0.0);
      for(int i = 0; i < 100;)
      {
      String title = String("Processing i+1 of 100");
      SetTitle(title);
      SetPercent((i + 1) / 100);
      ++i;
      }
      SetPercent(1.0);
      }
      

      I'm guessing because Main() is on another thread. Is this possible?

      WP.

      posted in Cinema 4D SDK sdk c++
      WickedPW
      WickedP
    • RE: Link to online docs

      @ferdinand ah great, thanks. For others reading, may need a hard-refresh to get it to show.

      68055f1b-8472-4768-8b26-64b7edc1a9b5-image.png

      Cheers,

      WP.

      posted in General Talk
      WickedPW
      WickedP
    • RE: Using recent VS to make older builds

      Thanks Maxime. And apologies for the delay - I didn't see the response.

      WP.

      posted in Cinema 4D SDK
      WickedPW
      WickedP