原始问题:如何将文本/数字字段值复制到LinuxforBlderv2.93.4的剪贴板上?https://blender.stackexchange.com/questions/239139/how-to-copy-a-text-numeric-field-value-to-clipboard-on-linux-for-blender-v2-93-4
我打开搅拌机,点击立方体,显示它的变换,点击X,它选择文本“2m”,我键入5,点击回车,它显示“5m”,我再次点击它,它选择“5m”,当鼠标超过"5“选择数字时,我点击ctrl+c,我点击TAB (到Y字段),我点击ctrl+v,但是它粘贴在剪贴板上的东西,而不是”5m“!如果我尝试的话,连"5“都没有!问题是,它不复制到剪贴板,它可以粘贴从但不复制到!
我为"text.copy“操作添加了几个键映射( ctrl+c ctrl+insert之外),比如鼠标移动、F5等等,但问题似乎是搅拌器无法将任何东西发送到X剪贴板。
我试图找到一种方法让它转储到终端或搅拌机的信息,但我无法找到一种方法让它发生的精确。如果我运行像blender --log "*undo*"这样的搅拌器,它会转储不精确的显示值,比如“2.12m”,而不是精确的全值"2.12345",这会有所帮助,但还不够。如果它可以精确地记录下来,如果显示的值可以被精确地显示出来,它可能是可以工作的。
你还能想象会发生其他什么花招吗?
gcore ... |strings可以在那里找到唯一的“纯文本”数字I(在选择文本时输入3次,一次不键入),但附近没有固定文本可用作提示/提示/钩子,说明它是选定的文本。可能是十六进制的东西?
我觉得这可能是蟒蛇的虫子?但我还找不到搅拌机代码的位置。
搅拌机2.93.4 ubuntu 20.04
关联:https://blender.stackexchange.com/questions/124294/clipboard-not-working-on-ubuntu-18-04-in-blender-2-79b,但没有任何帮助。
发布于 2021-09-28 02:08:10
这是一个与parcellite相关的问题。要使搅拌器和分体处理,您必须禁用parcellite的“剪贴板/UseCopy(Ctrl+C)”选项,并让它只使用“主要(选择)”。
老掉牙的回答:
下面的脚本是做什么的?
完全过分,但也可能适用于其他应用程序:
cat >copyThruOCR.sh
#!/bin/bash
echo "HELP:"
echo "depends on: scrot, tesseract, yad, xterm"
echo "bind this script to ex.: Alt+C using xbindkeys-config (remember to run xbindkeys just after)"
echo "use dark mode for best contrast on the application, so ex.: clicking the the field in blender will make it black background and white text!"
echo "tip: select more to the left than the limit of the text/number, works better"
echo "tip: select just below the text/number, if it is too much below it may just fail"
echo "it may still fail sometimes..."
set -x
FUNC() {
strFl="/tmp/`basename $0`.png";
rm "$strFl" "$strFl.txt"
bFail=false
str=""
strP=""
fSleep=0.25
iScrotRetryMax=8; # 2s
for((iScrotRetry=0;iScrotRetry/dev/null 2>&1;then
str="$(head -n 1 "${strFl}.txt")" #1st line
str="$(echo "$str" |cut -d " " -f1)" #1st word/column
str="$(echo "$str" |tr -d "\r\n ")" #remove anything invalid
echo "RESULT:"
echo "$str"
echo
echo "TextFile:"
cat "${strFl}.txt"
echo
if [[ -z "`echo -n "${str}" |tr -d '[:digit:].+-'`" ]];then #COMMENT this number check if you prefer everything
echo "COPYING TO CLIPBOARD: '${str}'"
echo -n "$str" |xclip -i -selection primary -rmlastnl;
echo -n "$str" |xclip -i -selection secondary -rmlastnl;
echo -n "$str" |xclip -i -selection clipboard -rmlastnl;
else
strP="PROBLEM: not a number"
bFail=true
fi
else
strP="PROBLEM: tesseract fail"
bFail=true
fi
else
strP="PROBLEM: scrot fail"
bFail=true
fi
echo "$strP"
if $bFail;then yad --geometry=100x50+0+0 --title "`basename $0` FAILED" --text "$strP. '$str'" --timeout 1 --ontop --center;fi #COMMENT to get no warning
read -p "press a key to exit (2s)..." -t 2 -n 1
};export -f FUNC;
xterm -geom 50x100+0+0 -e bash -c FUNC;exit #COMMENT to not show terminal log
FUNC如果你能改进它(使它更可靠),放弃你的提示帮助!我想让它自动抓取周围的鼠标位置的矩形,问题是如何清理它的不必要的内容,以一种方式,OCR将正常工作。
https://unix.stackexchange.com/questions/670919
复制相似问题