Skip to content

Commit dcebbf7

Browse files
committed
Initial Commit
1 parent 199302e commit dcebbf7

28 files changed

+6778
-0
lines changed

.eslintrc.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"plugins": [
9+
"@typescript-eslint"
10+
],
11+
"rules": {
12+
"@typescript-eslint/naming-convention": "warn",
13+
"@typescript-eslint/semi": "warn",
14+
"curly": "warn",
15+
"eqeqeq": "warn",
16+
"no-throw-literal": "warn",
17+
"semi": "off"
18+
},
19+
"ignorePatterns": [
20+
"out",
21+
"dist",
22+
"**/*.d.ts"
23+
]
24+
}

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish new release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
node_version:
7+
description: 'NodeJs Version to use'
8+
default: '14.18.2'
9+
required: true
10+
11+
jobs:
12+
build_release_vsix:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@master
17+
18+
- name: Setup Node.js ${{ github.event.inputs.node_version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ github.event.inputs.node_version }}
22+
23+
- name: Run npm ci
24+
run: npm ci --prefer-offline
25+
shell: bash
26+
27+
- name: Install vsce
28+
run: npm i -g vsce
29+
shell: bash
30+
31+
- name: get-npm-version
32+
id: package-version
33+
uses: martinbeentjes/npm-get-version-action@main
34+
35+
- name: Compile and Build VSIX
36+
run: vsce package -o cinema4d-connector-${{ steps.package-version.outputs.current-version}}.vsix
37+
shell: bash
38+
39+
- name: Create Release
40+
id: create_release
41+
uses: actions/create-release@v1
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
with:
45+
tag_name: cinema4d-connector-${{ steps.package-version.outputs.current-version}}
46+
release_name: Release cinema4d-connector-${{ steps.package-version.outputs.current-version}}
47+
draft: false
48+
prerelease: false
49+
50+
- name: Upload artifact
51+
uses: AButler/upload-release-assets@v2.0
52+
with:
53+
files: '*.vsix'
54+
repo-token: ${{ secrets.GITHUB_TOKEN }}
55+
release-tag: cinema4d-connector-${{ steps.package-version.outputs.current-version}}
56+

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Compiled binary addons (https://nodejs.org/api/addons.html)
2+
out/
3+
4+
*.vs
5+
*.vsix
6+
7+
# Dependency directories
8+
node_modules/

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"dbaeumer.vscode-eslint"
6+
]
7+
}

.vscode/launch.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// A launch configuration that compiles the extension and then opens it inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
],
15+
"outFiles": [
16+
"${workspaceFolder}/out/**/*.js"
17+
],
18+
"preLaunchTask": "${defaultBuildTask}"
19+
}
20+
]
21+
}

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.exclude": {
4+
"out": false // set this to true to hide the "out" folder with the compiled JS files
5+
},
6+
"search.exclude": {
7+
"out": true // set this to false to include "out" folder in search results
8+
},
9+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
10+
"typescript.tsc.autoDetect": "off"
11+
}

.vscode/tasks.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// See https://go.microsoft.com/fwlink/?LinkId=733558
2+
// for the documentation about the tasks.json format
3+
{
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "esbuild",
9+
"problemMatcher": "$tsc-watch",
10+
"isBackground": true,
11+
"presentation": {
12+
"reveal": "never"
13+
},
14+
"group": {
15+
"kind": "build",
16+
"isDefault": true
17+
}
18+
}
19+
]
20+
}

.vscodeignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.vscode/**
2+
.vscode-test/**
3+
src/**
4+
.gitignore
5+
.yarnrc
6+
vsc-extension-quickstart.md
7+
**/tsconfig.json
8+
**/.eslintrc.json
9+
**/*.map
10+
**/*.ts

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Cinema 4D Connector - Visual Studio Code Extension
2+
3+
Provides an extension for VS Code to exchange code between the Script Manager of Cinema 4D and VS Code.
4+
5+
This extension is only functional with the [Cinema 4D Plugin](https://github.com/PluginCafe/Cinema4D_Connector-Cinema4D_Plugin) for Visual Studio Code counterpart plugin. The extension also provides syntax highlighting for resource files and string resources as used by Cinema 4D, as well as other tools to assist Cinema 4D plugins and scripts developers.
6+
7+
All the commands of this extension can be found by pressing `ctrl+shift+P` and searching for `C4D`.
8+
9+
![Cinema 4D Python Debugging in Visual Studio Code](https://github.com/PluginCafe/Cinema4D_Connector-VisualStudioCode_Extension/blob/main/image/vscode_example.png)
10+
11+
## Installation
12+
13+
To use all the features it is necessary to install the following two extensions:
14+
15+
- 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.
16+
17+
- 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).
18+
19+
## Features
20+
21+
In-depth documentation can be found in [Cinema 4D Connector - Documentation](https://github.com/PluginCafe/Cinema4D_Connector-Cinema4D_Plugin/blob/main/documentation.md).
22+
23+
* **Load Script in Script Manager**: Load the active script from Visual Studio Code editor to Cinema 4D script manager.
24+
* **Execute in Cinema 4D as a Script in Script Manager**: Execute a script directly into Cinema 4D.
25+
* **Debug in Cinema 4D as a Script in Script Manager**: Start a debugging session for the given script to Cinema 4D.
26+
* **Autocompletion for the `c4d` Python package**: Provide autocompletion on the fly when typing for the c4d package.
27+
* **Load Cinema 4D Script Template**: Loads a template script.
28+
* **Python Console output forwarding**: Cinema 4D Python console outputs is forwarded to a Visual Studio Code console called "Cinema 4D".
29+
* **Syntax highliting for \*.res and \*.str files**: The syntax for files with the extension .str and .res has a syntax colouring.
30+
31+
## Known Issues
32+
33+
- Autocompletion does not work for the `maxon` package.
34+
- Autocompletion does not work for temporary scripts from Cinema 4D, those whose path begins with `Root@`, e.g. `Root@12345678/Scripts@12345678/untilted.py.`
35+
- Autocompletion for methods from the `c4d` package will generate incomplete default argument if this argument is part of the `c4d` package, e.g. the automcpletion will output only `BaseContainer` while it should be `c4d.BaseContainer`.
36+
- When the `Load Script in Script Manager` command is used on an untitled file, it creates a new temporary file in Cinema 4D and this is returned to Visual Studio Code. This file should be used to exchange data to/from Cinema 4D.
37+
- The first debugging session will show a message about the deprecated use of `ptvsd`, this is a false positive and can be ignored.
38+
39+
## License
40+
41+
This extension is licensed under the [Apache 2.0 License](LICENSE).
42+

image/maxon_logo.png

10.2 KB
Loading

0 commit comments

Comments
 (0)