Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit 54a27ad

Browse files
committed
Initial commit
1 parent a24817a commit 54a27ad

16 files changed

+1010
-0
lines changed

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
.vs/
3+
_obj/
4+
generated/
5+
__MACOSX/
6+
*.eclipse/
7+
*.xcodeproj/
8+
9+
10+
*.sln
11+
*.vcxproj
12+
*.vcxproj.filters
13+
*.cbp
14+
*.props
15+
*project.pbxproj
16+
*SConscript
17+
*.DS_Store
18+
19+
*.ilk
20+
*.pdb
21+
*.xdl64
22+
*.xdl64.manifest
23+
*.xlib

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Cinema 4D Connector - Cinema 4D Plugin
2+
3+
Provides a plugin for Cinema 4D to exchange code between the Script Manager and external code editors.
4+
5+
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`.
6+
7+
## Installation
8+
9+
To use all the features it is necessary to install the following two extensions:
10+
11+
- 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.
12+
13+
- 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).
14+
15+
## Features
16+
17+
In-depth documentation can be found in [Cinema 4D Connector - Documentation](https://github.com/PluginCafe/Cinema4D_Connector-Cinema4D_Plugin/blob/main/documentation.md).
18+
19+
## Requirements
20+
21+
- Cinema 4D S26.
22+
23+
## Known Issues
24+
25+
If settings are not present in the preferences, you do not have the correct version of Cinema 4D.
26+
27+
## License
28+
29+
This extension is licensed under the [Apache 2.0 License](LICENSE.txt).
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Supported platforms - can be [Win32;Win64;OSX;Android;Linux;iOS]
2+
Platform=Win64;OSX;Linux
3+
4+
// Type of project - can be [Lib;DLL;App]
5+
Type=DLL
6+
7+
// Enable unity builds for the following directories
8+
unity=;
9+
10+
// API dependencies
11+
APIS=cinema.framework;core.framework;math.framework;crypt.framework;python.framework;misc.framework;network.framework;cinema_hybrid.framework
12+
13+
// Legacy C4D component
14+
C4D=true
15+
16+
stylecheck.level=3 // must be set after c4d=true
17+
18+
19+
ModuleId=net.sdk.maxon.cinema4d_connector
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#ifndef C4D_SYMBOLS_H__
2+
#define C4D_SYMBOLS_H__
3+
4+
enum
5+
{
6+
IDS_WEBSOCKET_JSON_CE = 1000,
7+
};
8+
9+
#endif // C4D_SYMBOLS_H__
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef PREFS_WEBSOCKET_JSON_CE__
2+
#define PREFS_WEBSOCKET_JSON_CE__
3+
4+
enum
5+
{
6+
PREFS_WEBSOCKET_JSON_CE_GRP = 1000,
7+
PREFS_WEBSOCKET_JSON_CE_PORT,
8+
};
9+
10+
#endif // PREFS_WEBSOCKET_JSON_CE__
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CONTAINER pref_websocket_json_ce
2+
{
3+
NAME pref_websocket_json_ce;
4+
5+
GROUP PREFS_WEBSOCKET_JSON_CE_GRP
6+
{
7+
DEFAULT 1;
8+
COLUMNS 1;
9+
10+
LONG PREFS_WEBSOCKET_JSON_CE_PORT {}
11+
}
12+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// C4D-StringResource
2+
// Identifier Text
3+
4+
STRINGTABLE
5+
{
6+
IDS_WEBSOCKET_JSON_CE "WebSocket Json";
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
STRINGTABLE pref_websocket_json_ce
2+
{
3+
pref_websocket_json_ce "WebSocket JSON Settings";
4+
5+
PREFS_WEBSOCKET_JSON_CE_PORT "Port";
6+
}

cinema4d_connector/source/main.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include "c4d_plugin.h"
2+
#include "c4d_resource.h"
3+
#include "websocket_json_preference.h"
4+
#include "maxon/code_exchange.h"
5+
6+
::Bool PluginStart()
7+
{
8+
if (!RegisterWebSocketJsonCodeExchangePreferences())
9+
return false;
10+
11+
return true;
12+
}
13+
14+
void PluginEnd()
15+
{
16+
17+
}
18+
19+
::Bool PluginMessage(::Int32 id, void* data)
20+
{
21+
switch (id)
22+
{
23+
case C4DPL_INIT_SYS:
24+
{
25+
if (g_resource.Init() == false)
26+
return false;
27+
return true;
28+
break;
29+
}
30+
}
31+
32+
return false;
33+
}

0 commit comments

Comments
 (0)