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. user168462
    U
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 11
    • Best 0
    • Controversial 0
    • Groups 0

    user168462

    @user168462

    0
    Reputation
    3
    Profile views
    11
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    user168462 Unfollow Follow

    Latest posts made by user168462

    • RE: AdditionalCompileOptions in xcode

      Hi Manuel,
      Actually I couldn't find a clean answer..
      The only way I found was to set some files into ../frameworks/settings/...

      Best,

      posted in Cinema 4D SDK
      U
      user168462
    • AdditionalCompileOptions in xcode

      Hi guys,
      I am currently looking at adding some compilation option into projectdefinition.txt in macos.
      When I look into https://developers.maxon.net/docs/cpp/2023_2/page_maxonapi_projecttool.html I can find the AdditionalCompileOptions which is for windows but not the equivalent for macos.
      Do you know how I can pass option to xcode through the project definition ?
      Thank you in advance
      Best

      posted in Cinema 4D SDK
      U
      user168462
    • RE: Discover when a tag has been disabled

      Thank you for your reply, I guess there is no way to observe a tag if you are not implementing it.

      Best

      posted in Cinema 4D SDK
      U
      user168462
    • Discover when a tag has been disabled

      Hello guys,
      I am trying to detect when a tag is enabled/disabled(here target camera specifically).
      For that purpose I am looking at the messages coming from cinema4d.
      While I can identify the messages id pattern: I receive 604, 1018484 and then 1685218156.
      I cannot retrieve from which message those ID belong to.

      1. How can I know when a tag has been disabled or not? If there a solution with the messages shown or a simpler one ?

      I Also noticed, that I receive the same message when I click on the button located on the left of Enable (see image below).

      fb135c8a-6ee0-49ac-ae77-8e1849cb1116-image.png

      1. What the purpose of the button located on the left of Enable?

      Thank you in advance for your reply.
      Best

      posted in Cinema 4D SDK c++
      U
      user168462
    • RE: Compute distance from a point to a mesh

      Hi Ferdinand, thank you for your detailed reply.
      I am looking for hit point. Then if I understand well, my only way would be to use GeRayCollider on all objects ?

      Best,

      posted in Cinema 4D SDK
      U
      user168462
    • Compute distance from a point to a mesh

      Hi guys,
      I would like to compute the distance from a point to a mesh while editing a document.

      • Requested method:
        - [IN] start point
        - [IN] direction vector
        - [IN] radius (area to look)
        - [OUT] position of a hit if it exist (or a distance to the starting point).

      • Current plugin structure implementation:

        MessagePlugin objects' scene coordinates.

      • Example:
        25623802-38bd-41fd-b275-a79df57dde14-image.png

      Here I would like to know the first element which is hit by the blue line from the camera.
      I took here the camera to have a visualization, however it can be a random start point.

      I considered few options:

      1. Geraycollider: gives the distance if you know the target object, however I don't know it.
      2. VideoPostData plugin to get VolumeData and then use TraceGeometry method. However, it seems that it is not called and the time but only when a rendering is done.

      Do you have any hint or recommended method to do that?

      Thank you in advance
      Best

      posted in Cinema 4D SDK
      U
      user168462
    • RE: Retrieving camera view volume

      @cairyn Thank you!

      posted in Cinema 4D SDK
      U
      user168462
    • Retrieving camera view volume

      Hello guys,
      I am working with cameras to do some computation I need to retrieve its current view volume. I call view volume, the visible scene's "cone" from the camera pov.
      See picture below (this cone is visible when the option "Show Cone" in camera object is switched on):
      c4909046-2363-47ec-a65e-cd7b43109806-image.png

      1. Does it exist a function returning this volume no matter what kind of camera is used?

      2. While I can compute it for perspective camera, I couldn't guess the right parameters to compute it for parallel camera.

      
      struct frustum{
       Float farVal, nearVal, right, left, top, bottom;
      }f;
      
      cam = GetCamera()) {
      Float near = 0;
      Float far = 1000;
      Float focusLength= getParam(CAMERAOBJECT_TARGETDISTANCE, DA_REAL, cam).DReal;
      		if (getParam(CAMERAOBJECT_NEAR_CLIPPING_ENABLE, DA_LLONG, cam).DLLong != 0) {
      			near = getParam(CAMERAOBJECT_NEAR_CLIPPING, DA_REAL, cam).DReal;
      		}
      		if (getParam(CAMERAOBJECT_FAR_CLIPPING_ENABLE, DA_LLONG, cam).DLLong != 0) {
      			far = getParam(CAMERAOBJECT_FAR_CLIPPING, DA_REAL, cam).DReal;
      		}
      		auto fov_vertical = getParam(CAMERAOBJECT_FOV_VERTICAL, DA_REAL, cam).DReal;
      
      		
      		auto widthHalf = focusLength * maxon::Tan(fov / 2.0)/100.0;
      		auto heightHalf = focusLength * maxon::Tan(fov_vertical / 2.0) / 100.0;
      		
      		f.farVal = far;
      		f.nearVal = near;
      		f.right = widthHalf;
      		f.left = -f.right;
      		f.top = heightHalf;
      		f.bottom = -f.top;
      		return 0;
      	}
      

      Any help is welcome.
      Thank you in advance

      posted in Cinema 4D SDK sdk c++ maxon api
      U
      user168462
    • RE: Get list of all commands and their associated information

      Thank you m_adam it works perfectly !
      Here is the code if it helps someone

      	AutoAlloc<AtomArray> pList;
      	FilterPluginList(pList, PLUGINTYPE::COMMAND, true);
      	for (size_t i = 0; i < pList->GetCount(); i++)
      	{
      		auto elem = static_cast<BasePlugin*> (pList->GetIndex(i));
      		DiagnosticOutput(elem->GetName()+ ", "+ String::IntToString(elem->GetID())+ ", " + GetCommandHelp(elem->GetID()));
      	}
      

      I have also another question, before I was trying to discover commands thought the menu then I could categorize it.
      Do you think there is a way to collect such information (for instance know that "New project" command is located into file submenu.

      Thanks

      posted in Cinema 4D SDK
      U
      user168462
    • Get list of all commands and their associated information

      Hello Guys,

      1. Is it possible to get a full list of command ID ?

      For now I understand from different forum posts that the only way is to get it from the command palette (for instance in https://developers.maxon.net/forum/topic/3168/2548_command-id/2)
      For now I am doing this kind of recursion to get a list of command from the ui.
      The code below shows me two kind of results:

        1. IDM_XXX
        2. PLUGIN_CMD_${ID}
      

      The first one is a string while the second contains an id but does not corresponds to the targeted command id.

      void EnumerateCmds(BaseContainer* item) {
      	BrowseContainer bc(item);
      	Int32 id = 0;
      	GeData* dat = nullptr;
      	while (bc.GetNext(&id, &dat))
      	{
      		switch (id) {
      			case MENURESOURCE_SUBMENU:
      				DiagnosticOutput("SUBMENU [");
      				EnumerateCmds(dat->GetContainer());
      				DiagnosticOutput("]");
      				break;
      			case MENURESOURCE_STRING:
      				DiagnosticOutput("MENURESOURCE_STRING " + dat->GetString() + "[");
      				EnumerateCmds(dat->GetContainer());
      				DiagnosticOutput("]");
      				break;
      			case MENURESOURCE_COMMAND:
      				DiagnosticOutput("MENURESOURCE_COMMAND=" + dat->GetString())
      				break;
      			case MENURESOURCE_SEPERATOR:
      				break;
      			case MENURESOURCE_SUBTITLE:
      				DiagnosticOutput("subtitle="+ dat->GetString());
      				break;
      			case MENURESOURCE_MENURESOURCE:
      				DiagnosticOutput("MENURESOURCE_MENURESOURCE=" + dat->GetString() + "[");
      				EnumerateCmds(dat->GetContainer());
      				DiagnosticOutput("]");
      				break;
      			case MENURESOURCE_SUBTITLE_ICONID:
      				DiagnosticOutput("MENURESOURCE_SUBTITLE_ICONID id value: " + dat->GetInt32());
      				break;
      			case MENURESOURCE_ASSET:
      				DiagnosticOutput("MENURESOURCE_ASSET" + dat->GetString() + "[");
      				break;
      			default:
      				DiagnosticOutput("error");
      				break;
      		}
      
      1. Are command's id same for their icon ? Otherwise how could we fetch it?

      Thank you in advance for any help

      Best

      posted in Cinema 4D SDK c++ maxon api sdk
      U
      user168462