Unity3d: No Drag&Drop has been setup - unity3d-2dtools

I was working on a Unity 2D game project on OS X 10.10, and I can't drag file or folder, it will show this error.
No Drag&Drop has been setup. Please
UnityEditor.DockArea:OnGUI()
I have tried:
save project and then restart
click Assets folder and choose Reimport All
But it seems not work, how to fix it?

Recently I have the same problem and what I did was quit Unity and force quit the pboard process via Activity Monitor and then launch Unity again, it works for me.

Unity uses NSPasteboard (OSX shared manager for clipboard) to hold the data for Drag&Drop, so any process that monitors/modifies the clipboard may be messing with the Drag&Drop.
I think there might be a Chrome extension that would be generating notifications that would for some reason break drag and drop. Disable all your extensions in google chrome and if that doesn't solve your problem in Unity then do a fresh install of google chrome.
Edit: As suggested by other users, another solution that might work is
Quit Unity and force quit the pboard process via Activity Monitor and
then launch Unity again.
Hope it helps.

Based on the answer provided by Sinyo I created a small shell script to speed up the process and thought I would share. [For Mac only] It closes Unity, kills the pboard process, then reopens Unity.
#!/bin/sh
osascript -e 'quit app "Unity"'
pid=$(ps -fe | grep 'pboard' | grep -v grep | awk '{print $2}')
if [[ -n $pid ]]; then
kill $pid
else
echo "Does not exist"
fi
osascript -e 'launch the application "Unity"'

I know this is an old thread but I thought I might contribute. I was having the "No Drag&Drop" error in an implementation of a property drawer and tried all the tips given here with no success. I was about to give up and blame it on unity, but then I found a solution. You see, I was setting the object references and calling the DragAndDrop.SetGenericData() method during the mouseDown event.
I changed it so that in the MouseDrag event I check to see if there is existing DragAndDrop (checking for null in the return of DragAndDrop.GetGenericData()). If its null, I set the data during on MouseDrag just before calling DragAndDrop.StartDrag().
This fixed the problem. Hope it helps someone else.

This is the simplest way to accomplish the best answer:
killall -HUP pboard
(from terminal or similar, obviously)

Based on #user3130047's answer, this is another version. Mac Only.
Quit Unity.
In console, put this command and execute it.
ps aux | grep pboard | grep -v grep | awk '{print $2}' | xargs kill -9 | launchctl start com.apple.pboard
Open Unity.
That's it.
But, this may cause your another opened applications copy&paste doesn't work. So, you need to restart them.

Related

Fedora 30: GTK fails to load appmenu-gtk-module

I am learning to program in Python and Rust. On different versions of Ubuntu these programs compiled and ran perfectly. Now that I have a dedicated Fedora 30 KDE system, every time I try and build a program, I get a warning: Failed to load module "appmenu-gtk-module"
I have tried looking this up and have re/installed anything GTK on my system. The programs otherwise function well, but no menus are drawn. I was also trying things in GNOME and hit the same thing.
I am also using QT. Those programs also build and run fine, but again, no menu.
I'm going bonkers with this. Any help is appreciated.
The appmenu-gtk module is not packaged on Fedora. (GNOME doesn't support them anyway.)
The real questions are:
Why is it configured to load? Did you copy or share GTK config files from an Ubuntu system? You should remove this module from your settings.
Even with improper configs I don't believe this should result in menus not appearing. It should just fail to load and work as normal. How is your application using menus?
I finally got so fed up with getting this error that I went full nerd-diagnosis, and ran this command to find out which file contained the errant reference to the appmenu-gtk (the package that would provide this is not installable on my system either).
(Replace "dolphin" with the command that is giving you the error.)
strace -e openat,access dolphin 2>&1 |grep -v ENOENT |awk '/appmenu-gtk/ {exit} !/appmenu-gtk/ {print}'|cut -d '"' -f2 |sort|uniq|xargs grep appmenu-gtk 2>/dev/null
This will then give you a list of files which contain the line appmenu-gtk, and in my case it was ~/.config/gtk-3.0/settings.ini. From there I just commented it out, and that gets rid of the error message (not sure if this will fix your problem of not having any menus, but you might just be able to edit that line to fix it in another way if commenting it out doesn't work).

How do I correct error in opening cron editor?

I am trying to open cron editor using command crontab -e
but I am getting error fclose: There is not enough space in the file system.
Any help would be appreciated
Thanks
Sachin
Your disk is full. Check df -hk to know which filesystem is at 100%. Afterwards, check what you can do to delete or copy obsolete files in order to clean your disk (the command du -k . | sort -n might be useful to find the highest diskspace usage directories).

How to kill a tmux pane along with the process running on it?

Let's say you run a command like grunt serve on a tmux pane,
and you kill the pane on which the command is running. I found that
the process is not killed:
ps aux | grep grunt
still shows that grunt is running even though the pane is gone.
How do you kill a tmux pane along with the process(es)?
To stop the program running you can close the pane by entering <C-B> x and then entering y.
Just do: <CTRL-B>:kill-pane
Use Ctrl + b¹, > to get a menu with this and other useful commands:
This is what uses the Spotify plugin.
¹ Or the chosen tmux escape sequence.
Other notes and sources
tmux list-keys | grep display-menu #
curl cht.sh/tmux # Online cheatsheet
https://wiki.archlinux.org/title/tmux
You may find the tmux-safekill plugin useful.
I wanted it to kill Ruby processes, so I had to fork the repo to add that functionality in, so I'm sure you could do the same for grunt processes if you don't get all the functionality you need from the repo directly.

stop the processes started by the rtd command

I have installed RTD from xolvio and it works fine until you want to stop it.
Expecting a meteor or meteorite behaviour, I pressed CTRL+C to stop the process. The mrt command and the mongo instance are still running. So is the selenium server.
There are no indications on how to stop the thing in the documentation. It must be something I'm missing.
thanks in advance for your help.
it is as simple as running grunt bgShell:killAll
I had to make some changes to the killall function in rtd/Gruntfile.js in order to make it work on Mac OS 10.7.5:
replace ps -efwith ps -A
it appears that the process number is not at the same place. replacing print $2 with print $1 does the trick.
hope that helps someone

Unable to hide a running process in terminal

I yesterday upgraded by MacPorts' apps which took apparently about 4 hours.
It was irritating to see the installation process going on in one tab in terminal.
Problem: to hide a running process in terminalsuch that it does not take space in my working area
I found today that there a new command coproc in Bash 4:
coprocess is executed asynchronously
in a subshell, as if the command
established between the executing shell and the coprocess
I am not sure whether you can use it to solve the problem or not. I did not manage to use it.
How can you hide the running process such that it is not visible in terminal but it continues to run?
Did you consider Ctrl + Z to put the process in pause, then bg to run this one in background?
To detach your process from the terminal, you can then type disown. You can now close the terminal, and even your session.
The problem here is that the outputs will appear anyway in the bash.
You can also start your program in screen. This command provide an easy way to start a program, close the console and retrieve it later.
I suspect you are looking for nohup
nohup LongRunningNoisyProgram &
will run the program, log the output to a file so you don't see it, push the program into the background, and won't cancel the program if you exit your terminal later while it is still running.
There is at least one thing the other repliers have not covered: how to manage hiding processes.
Suppose you have 100 background processes created with "nohup find / &". You want to quit them to really see how the background processes work. Please, use the command:
ps -ej | awk '! /grep/ && /find/ {print $2}' | xargs kill -9
Then, you may want to know how to control the keys to hide processes. You can change it to p, where susp stands for CTRL+z (^Z):
stty susp p
You can see the keys here:
stty -a
Please, compare the stdouts before and after the change. The command is particularly useful because it helps to remember other commands, such as ^W (to remove a word).
Jerome had an excellent tip about screen. I highly recommend to pursue the direction:
http://www.commandlinefu.com/commands/matching/screen/c2NyZWVu/sort-by-votes

Resources