This command (FAssetRegistryModule::AssetCreated) although it works well when used in "Selected Viewport", it crashes in Standalone mode. Which is the macro for not executing both in PIE and Standalone ?
#if WITH_EDITOR
FAssetRegistryModule::AssetCreated(DynMaterial);
#endif
This is for executing commands in "Selected Viewport" and "Standalone" when in Editor.
if (GetWorld()->WorldType == EWorldType::PIE)
{
FAssetRegistryModule::AssetCreated(DynMaterial);
}
Related
I have a problem on my nvim LSP.
according to mason plugin the pyright is downloaded and I on other IDE the lsp works great.
when i open python file with neovim it didn't recognized import and basic functions.
someone can handle this situation?
maybe it's because Lspinfo tell me that it didn't get the python root directory?import don't auto complete pythonpyright is downloaded via masonLSPInfo description
on other languages it works so don't really understand the problem
Same as me, at the moment I solved like this (it happens in some languages for me too):
local status_ok, mason = pcall(require, "mason")
if not status_ok then
return
end
local status_masonlsp_ok, mason_lspconfig = pcall(require, "mason-lspconfig")
if not status_masonlsp_ok then
return
end
local servers = {
"sumneko_lua",
"rust_analyzer",
"tailwindcss",
"bashls",
"pyright",
-- "csharp_ls",
"html",
"omnisharp",
"gopls",
}
mason.setup(settings)
mason_lspconfig.setup({
ensure_installed = servers,
automatic_installation = true,
})
So when I open nvim they are installed automatically.
I created a very simple Unity Server, which uses a simple script (taken from here).
I tried to build it through the ubuntu bash with the following command:
~/Unity/Hub/Editor/2019.4.30f1/Editor/Unity -batchmode -nographics -logfile stdout.log -projectPath /path/to/the/project -buildLinux64Player /project/build/destination -quit
And it worked! It's able to create a working build. The problem is that the 3D windows is displayed as well. I don't want to interact with any game object.
Is there a way to create or run the executable without GUI?
As you can see I used "batchmode" and "nographics" flags which were supposed to prevent the user interface to appear.
Which sort of mistake I have done?
Thanks for your time.
As you can see I used "batchmode" and "nographics" flags which were supposed to prevent the user interface to appear.
yes and it didn't!
However, these two flags only apply to this instance of the UnityEditor which performs the build ... they do not apply to the actual resulting built application ;)
Usually you would go to the BuildSettings and enable
Server Build
Enable this checkbox to build the Player for server use and with no visual elements (headless) without the need for any command line options. When you enable this option, Unity builds managed scripts
with the UNITY_SERVER define, which means you can write server-specific code for your applications. You can also build to the Windows version as a console app so that stdin and stdout are accessible. Unity logs go to stdout by default.
under CommandLine Arguments you can find for how to trigger a scripted build via the console. Instead of using -buildXYZ you could use -executeMethod and within that method define the exact player and build settings you want before starting the build process
#if UNITY_EDITOR
using System;
using System.IO;
using UnityEditor;
using UnityEngine;
class ScriptedBuilds
{
// Invoked via command line only
static void PerformHeadlessLinuxBuild()
{
// As a fallback use <project root>/BUILD as output path
var buildPath = Path.Combine(Application.dataPath, "BUILD");
// read in command line arguments e.g. add "-buildPath some/Path" if you want a different output path
var args = Environment.GetCommandLineArgs();
for (var i = 0; i < args.Length; i++)
{
if (args[i] == "-buildPath")
{
buildPath = args[i + 1];
}
}
// if the output folder doesn't exist create it now
if (!Directory.Exists(buildPath))
{
Directory.CreateDirectory(buildPath);
}
BuildPipeline.BuildPlayer(
// Simply use the scenes from the build settings
// see https://docs.unity3d.com/ScriptReference/EditorBuildSettings-scenes.html
EditorBuildSettings.scenes,
// pass on the output folder
buildPath,
// Build for Linux 64 bit
BuildTarget.StandaloneLinux64,
// Use Headless mode
// see https://docs.unity3d.com/ScriptReference/BuildOptions.EnableHeadlessMode.html
// and make the build fail for any error
// see https://docs.unity3d.com/ScriptReference/BuildOptions.StrictMode.html
BuildOptions.EnableHeadlessMode | BuildOptions.StrictMode
);
}
}
#endif
and then e.g.
~/Unity/Hub/Editor/2019.4.30f1/Editor/Unity -batchmode -nographics -logfile stdout.log -projectPath /path/to/the/project -executeMethod ScriptedBuilds.PerformHeadlessLinuxBuild -quit
or with a custom build output path
~/Unity/Hub/Editor/2019.4.30f1/Editor/Unity -batchmode -nographics -logfile stdout.log -projectPath /path/to/the/project -buildPath path/to/build/destination -executeMethod ScriptedBuilds.PerformHeadlessLinuxBuild -quit
Maybe you could try to add the #define UNITY_SERVER directive to the top of your script. This will enable the server build and disable visual elements see 'Server Build' option in the 'Platform list' table
Background
I'm trying to auto-test my VSCode extension. The extension works with python files and uses vscode.executeDefinitionProvider and vscode.executeDocumentSymbolProvider on them.
Problem
vscode.executeDefinitionProvider always returns [], vscode.executeDocumentSymbolProvider always returns undefined.
Notes
When running the same code in a debug session of the extension (no test session), the commands work flawless.
I ensured the extensions to be available during the test and even manually activated them with
let ext = vscode.extensions.getExtension("ms-python.python");
assert.notStrictEqual (ext, undefined);
await ext?.activate ();
ext = vscode.extensions.getExtension("ms-python.vscode-pylance");
assert.notStrictEqual (ext, undefined);
await ext?.activate ();
Question
How do I get the commands to succeed during automated test.
Edit: Workaround
Apparently VSCode takes its time to really activate the extensions. I could get it working placing a await sleep (10000); in index.ts::run () before return new Promise((c, e) => {.
While this is working, it's a really unstable workaround, Is there any way to make the code wait until the whole environment is fully loaded?
In the end nothing really stably worked for me, so I resorted to the following (perfectly fine working) solution.
My auto tests are run from the productive environment, like any other extension.
In package.json I created a new command _test.
the command would run ./test/suite/index.ts : run().
Extension<T>::activate(): Thenable<T>
Returns: Thenable<T> - A promise that will resolve when this extension has been activated.
await ext?.activate();
I've been stuck for a little while now. I am using a PIC18J67j60 with MPLAB IDE (8.92).
My goal is to write my application (application works fine) at the address 0x2A in the PIC18 program memory.
To do so, I added the 18f67j60_g.lkr linker script into my application project (in the "Linker Script" folder). In this 18f67j60_g.lkr script, I added the line : " CODEPAGE NAME=page START=0x2A END=0xFFF".
Then I also added the c018i.c file in the "Source Files" folder of my project and into it, I changed the line "#pragma code _entry_scn=0x000000" to "#pragma code _entry_scn=0x2A".
Everything is compiling and I checked in my project.MAP file and as expected it says : " _entry_scn code 0x00002a program 0x000006" and "start 0x00002a end 0x00013d ".
Then, I use MPLAB IPE only to load the hex.file (obtained from the compilation) (with a pickit3) into my PIC18 (the picKit3 powers the PIC18). BUT in the output window of MPLAP IPE, it says the start writting address is 0x00.. instead of 0x2A. And I dont get why its not writing at 0x2A address..
Thank you for all your help
I need to execute a .jsx script for InDesign from command line (Windows).
For Illustrator, it works easily with the following command:
"C:\Program Files\Adobe\Adobe Illustrator CS6 (64 Bit)\Support Files\Contents\Windows\Illustrator.exe" "...\myscript.jsx"
Both applications Illustrator and ExtendScript Toolkit CS6 open then the script is automatically launched.
When I try the same for InDesign, it doesn't work (InDesign says 'Unable to open myscript.jsx ...').
I also tried to launch ExtendScript Toolkit from command line as below:
"C:\Program Files (x86)\Adobe\Adobe Utilities - CS6\ExtendScript Toolkit CS6\ExtendScript Toolkit.exe" "...\myscript.jsx"
The result is ExtendScript Toolkit application is opened with the script loaded, but nothing is executed.
Does anyone know how to launch the script? Is there a -run or -cmd argument to add?
For me on Osx it works like this:
/Applications/Adobe\ ExtendScript\ Toolkit\ CC/ExtendScript\ Toolkit.app/Contents/MacOS/ExtendScript\ Toolkit -run test.jsx
On Windows it should be:
"\path\to\ExtendScript Toolkit.exe" -run test.jsx
content of test.jsx:
//#target indesign
alert(app.name);
It needs the -run flag. When using -cmd it still executes the script but from ESTK. The //#target indesign gets ignored. With the -run the script gets passed to InDesign. Unfortunately the ESTK brings up a dialogue that warns to execute scripts from untrusted sources.
a solution of yours could be to call a visualbasic script from command line. That VB would then call the indesign jsx file based on having referenced teh indesign application itself. Kind of tricky but should definitively work.
If you are trying to execute using node, these are the best two ways I have found to execute Indesign scripts.
Version Agnostic
Credit rendertom inside his vscode/atom plugins.
const outputFilePath = path.resolve(os.homedir(), 'Documents', 'Adobe Scripts', 'myscript.js');
const hostCommand = {
darwin: {
command: 'osascript',
args: [
'-e',
`tell application id "com.adobe.indesign" to do script "${outputFilePath}" language javascript`
],
options: {}
},
win32: {
command: 'powershell',
args: [
'-command',
`"$app = new-object -comobject InDesign.Application; $app.DoScript('${outputFilePath}', 1246973031)"`
],
options: {shell: true} // Windows requires a shell
}
};
if (typeof hostCommand[process.platform] == 'undefined') {
throw new Error('This platform is not supported');
}
const {command, args, options} = hostCommand[process.platform];
const p = spawn(command, args, options);
I don't have Windows at hand to actually test it but I would start by looking at those links:
Run VBS in command line : http://ss64.com/vb/cscript.html
Run InDesign in VB:https://www.google.fr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwjj9_3JoPXMAhVI1BoKHUKMBT8QFggfMAA&url=https%3A%2F%2Fwww.adobe.com%2Fcontent%2Fdam%2FAdobe%2Fen%2Fdevnet%2Findesign%2Fsdk%2Fcs6%2Fscripting%2FInDesign_ScriptingGuide_VB.pdf&usg=AFQjCNFP8M8i3xrOqLp0zw3BGcNpnyhEXQ&sig2=pfFYnsgxXDpCf1A573JTDQ&bvm=bv.122676328,d.d2s
Look at the DoScript method for calling a JSX script.
myInDesign.DoScript myJavaScript,
Without ExtendScript Toolkit and on a Mac, you can use AppleScript or JavaScript for Automation (JXA).
This is how it's done in the jasminejsx library to execute jasmine specs in ExtendScript.
osascript -l "JavaScript" -e "var app = new Application('com.adobe.indesign'); app.doScript('$EXTENDSCRIPT', {language: 'javascript'});" &
See code here.