Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gr4ph0s committed Apr 20, 2022
1 parent a24817a commit 54a27ad
Show file tree
Hide file tree
Showing 16 changed files with 1,010 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .gitignore
@@ -0,0 +1,23 @@

.vs/
_obj/
generated/
__MACOSX/
*.eclipse/
*.xcodeproj/


*.sln
*.vcxproj
*.vcxproj.filters
*.cbp
*.props
*project.pbxproj
*SConscript
*.DS_Store

*.ilk
*.pdb
*.xdl64
*.xdl64.manifest
*.xlib
29 changes: 29 additions & 0 deletions README.md
@@ -0,0 +1,29 @@
# Cinema 4D Connector - Cinema 4D Plugin

Provides a plugin for Cinema 4D to exchange code between the Script Manager and external code editors.

The solution is server-based and requires a matching implementation on the side of the code editor. Such matching implementation is being provided with the Visual Studio Code extension `Cinema 4D Connector`.

## Installation

To use all the features it is necessary to install the following two extensions:

- The Cinema 4D plugin, downloadable [here](https://github.com/PluginCafe/Cinema4D_Connector-Cinema4D_Plugin/releases). Once downloaded, extract the archive to the Cinema 4D S26+ plugins folder. You then need to activate the extension in the Cinema 4D preferences in the `Extensions | Code Exchange` menu, activate the WebSocket Json checkbox.

- The `Cinema 4D Connector` extension for Visual Studio Code, directly accessible in the Visual Studio code marketplace, or download it [here](https://github.com/PluginCafe/Cinema4D_Connector-VisualStudioCode_Extension/releases).

## Features

In-depth documentation can be found in [Cinema 4D Connector - Documentation](https://github.com/PluginCafe/Cinema4D_Connector-Cinema4D_Plugin/blob/main/documentation.md).

## Requirements

- Cinema 4D S26.

## Known Issues

If settings are not present in the preferences, you do not have the correct version of Cinema 4D.

## License

This extension is licensed under the [Apache 2.0 License](LICENSE.txt).
19 changes: 19 additions & 0 deletions cinema4d_connector/project/projectdefinition.txt
@@ -0,0 +1,19 @@
// Supported platforms - can be [Win32;Win64;OSX;Android;Linux;iOS]
Platform=Win64;OSX;Linux

// Type of project - can be [Lib;DLL;App]
Type=DLL

// Enable unity builds for the following directories
unity=;

// API dependencies
APIS=cinema.framework;core.framework;math.framework;crypt.framework;python.framework;misc.framework;network.framework;cinema_hybrid.framework

// Legacy C4D component
C4D=true

stylecheck.level=3 // must be set after c4d=true


ModuleId=net.sdk.maxon.cinema4d_connector
9 changes: 9 additions & 0 deletions cinema4d_connector/res/c4d_symbols.h
@@ -0,0 +1,9 @@
#ifndef C4D_SYMBOLS_H__
#define C4D_SYMBOLS_H__

enum
{
IDS_WEBSOCKET_JSON_CE = 1000,
};

#endif // C4D_SYMBOLS_H__
10 changes: 10 additions & 0 deletions cinema4d_connector/res/description/pref_websocket_json_ce.h
@@ -0,0 +1,10 @@
#ifndef PREFS_WEBSOCKET_JSON_CE__
#define PREFS_WEBSOCKET_JSON_CE__

enum
{
PREFS_WEBSOCKET_JSON_CE_GRP = 1000,
PREFS_WEBSOCKET_JSON_CE_PORT,
};

#endif // PREFS_WEBSOCKET_JSON_CE__
12 changes: 12 additions & 0 deletions cinema4d_connector/res/description/pref_websocket_json_ce.res
@@ -0,0 +1,12 @@
CONTAINER pref_websocket_json_ce
{
NAME pref_websocket_json_ce;

GROUP PREFS_WEBSOCKET_JSON_CE_GRP
{
DEFAULT 1;
COLUMNS 1;

LONG PREFS_WEBSOCKET_JSON_CE_PORT {}
}
}
7 changes: 7 additions & 0 deletions cinema4d_connector/res/strings_en-US/c4d_strings.str
@@ -0,0 +1,7 @@
// C4D-StringResource
// Identifier Text

STRINGTABLE
{
IDS_WEBSOCKET_JSON_CE "WebSocket Json";
}
@@ -0,0 +1,6 @@
STRINGTABLE pref_websocket_json_ce
{
pref_websocket_json_ce "WebSocket JSON Settings";

PREFS_WEBSOCKET_JSON_CE_PORT "Port";
}
33 changes: 33 additions & 0 deletions cinema4d_connector/source/main.cpp
@@ -0,0 +1,33 @@
#include "c4d_plugin.h"
#include "c4d_resource.h"
#include "websocket_json_preference.h"
#include "maxon/code_exchange.h"

::Bool PluginStart()
{
if (!RegisterWebSocketJsonCodeExchangePreferences())
return false;

return true;
}

void PluginEnd()
{

}

::Bool PluginMessage(::Int32 id, void* data)
{
switch (id)
{
case C4DPL_INIT_SYS:
{
if (g_resource.Init() == false)
return false;
return true;
break;
}
}

return false;
}

0 comments on commit 54a27ad

Please sign in to comment.