I've got this script file that works flawlessly in the viewport, but stops completely when I start rendering it as an Animation.  import bpy import math  def my_handler(scene):     print('testing') # this will be printed out 3 times each frame when rendering the animation, but once only in the viewport.     #assigning variables to objects     a=bpy.data.objects['EmptyTop']     b=bpy.data.objects['EmptyRight']     text=bpy.data.objects['TextRightSide']      # formula for calculating distance     distance=str(int(math.hypot(a.location.x - b.location.x, a.location.y - b.location.y)*10))     text.data.body=distance  bpy.app.handlers.frame_change_post.append(my_handler)   (my_handler) is refreshed every frame as I've tested it by printing a test text in it. However, the main problem is that it does not do anything with the next code (bpy.data.objects). I've tried to change (bpy.data) to (scene) as shown  import bpy import math  def my_handler(scene):     print('testing')     #assigning variables to objects     a=scene.objects['EmptyTop']     b=scene.objects['EmptyRight']     text=scene.objects['TextRightSide']      # formula for calculating distance     distance=str(int(math.hypot(a.location.x - b.location.x, a.location.y - b.location.y)*10))     text.data.body=distance  bpy.app.handlers.frame_change_post.append(my_handler)   Worked just fine in the viewport but gave me this message when rendering the it as An animation  (line 7, in my_handler KeyError: 'bpy_prop_collection[key]: key "EmptyTop" not found')   Sooo, what should I do now to make it work?
this works in viewport but not in render.  import bpy from math import *  def frame_handler(scene):     z = scene.objects['Lift'].location[2]     scene.objects['Text'].data.body = str(floor(z / 4.0) - 2)  bpy.app.handlers.frame_change_pre.clear() bpy.app.handlers.frame_change_pre.append(frame_handler)   How to get it working in render? I've read  and changed from "bpy.data.objects" to "scene.objects" as already seen in the script. What am I missing? Blender v. 2.81.16  Edit. Tried that depsgraph thing mentioned in comments and changed to frame_change_post:  import bpy from bpy.app.handlers import persistent from math import *  @persistent  # maybe not relevant but doesn't harm anything? def frame_handler(scene, depsgraph):     z = scene.objects['Lift'].evaluated_get(depsgraph).location[2]     scene.objects['Text'].data.body = str(floor(z / 4.0) - 2)  bpy.app.handlers.frame_change_pre.clear() bpy.app.handlers.frame_change_post.clear() bpy.app.handlers.frame_change_post.append(frame_handler)   Now the Text doesn't show up at all in rendered (but works in viewport).
Why is my fire simulation so light? I have been struggling to get a match tip to actually look like it's on fire and no matter what material shaders I try, I can't seem to achieve what everyone else does, I can in other scenes, just not this one. :( I tried to use the absolute convergence test. $$\int_1^2\left|\frac{\sin{x}}{\log{x}}\right| \, dx&lt;\int_1^2\left|\frac{1}{\log{x}}\right| \, dx$$ but I'm not sure whether $\frac{1}{\log{x}}$ converges or not.  Thanks in advance! The popup when you click on your newest badge in your user profile has a &quot;Learn more&quot; button, but its alignment is suboptimal; it's too close to the top of its container:  It looks better with a 4px top margin: Placement of images in row using subfigure I want to put four figures in a single row. The code I am trying to use is taken from .  This puts three figures in a row. When I add a fourth one, I get three images in row and the last one appears in the second row. But I want all of them in one row. Here is my code.  \documentclass[12pt,twoside]{report}% Use this line for the print version of the thesis   \usepackage{graphicx} \usepackage{caption} \usepackage{subcaption} \begin{document}  \begin{figure}         \centering         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{gull}                 \caption{A gull}                 \label{fig:gull}         \end{subfigure}%           \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{gull}                 \caption{A gull2}                 \label{fig:gull2}         \end{subfigure}%          ~ %add desired spacing between images, e. g. ~, \quad, \qquad etc.           %(or a blank line to force the subfigure onto a new line)         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{tiger}                 \caption{A tiger}                 \label{fig:tiger}         \end{subfigure}         ~ %add desired spacing between images, e. g. ~, \quad, \qquad etc.           %(or a blank line to force the subfigure onto a new line)         \begin{subfigure}[b]{0.3\textwidth}                 \centering                 \includegraphics[width=\textwidth]{mouse}                 \caption{A mouse}                 \label{fig:mouse}         \end{subfigure}         \caption{Pictures of animals}\label{fig:animals} \end{figure} \end{document}   As I have mentioned above, it works for three figures.  But I can not use it for four figures. What should I change?   What does  width=\textwidth mean?   I changed    \begin{subfigure}[b]{0.3\textwidth}   to  \begin{subfigure}[b]{0.2\textwidth}   but it didn't help.  Then, I changed     \includegraphics[width=\textwidth]{mouse}   to  \includegraphics[width=0.5\textwidth]{mouse}   Still no solution. Remove Windows entry in GRUB menu A positional number system for enumerating fixed-size subsets? Many combinatorial objects have some associated positional number system.  For example, the subsets of a (finite) set S can be listed off by observing the bits of all $|S|$-bit numbers, treating the 1s and 0s as indicators for whether to pick a particular element or not.  Permutations of a finite set S can be found by examining the  representations of the first $|S|!$ natural numbers.  Is there an analogous positional number system for encoding k-element subsets of an n-element set?  Thanks! I have two tables A &amp; B. Table A id | name | num  Table B id | date | roll  id in table B is a foreign key which relates to the id in table A. I want to get the contents of table B where id is given and also along with that data, I need the name whose id is given from table A. NOTE: cannot use multiple queries separated by commas; need to do both the SELECTs in one query. How to print original variable's name in Python after it was returned from a function? What does 'close invalidated' mean Recently I flagged  as a duplicate. A few days later, when I checked it again to see if it was closed, I realized it wasn't.    Searching in Meta brought me to , where a comment suggested checking the timeline. So I checked the  and saw that the close flag was set as invalidated.  Does this mean that it was disputed? When I click on it I see only "This item is no longer reviewable." Do I need more reputation (3000+ ?) to view more detailed information? Custom post type - posts list - white screen of death rent a car, rent out a car, hire a car dpkg-divert: error: rename involves overwriting `/usr/lib/xorg/protocol.txt' with different file `/usr/lib/xorg/protocol-precise.txt', not allowed I just installed Ubuntu (12.04.4) and I upgraded to 13.10  I have no idea how to fix this :/  $ sudo apt-get install -f  Reading package lists... Done Building dependency tree        Reading state information... Done The following packages will be REMOVED:   xserver-common-lts-saucy 0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded. 1 not fully installed or removed. After this operation, 1,718 kB disk space will be freed. Do you want to continue [Y/n]? y (Reading database ... 175174 files and directories currently installed.) Removing xserver-common-lts-saucy ... Removing 'diversion of /usr/lib/xorg/protocol.txt to /usr/lib/xorg/protocol-precise.txt by xserver-common-lts-saucy' dpkg-divert: error: rename involves overwriting `/usr/lib/xorg/protocol.txt' with   different file `/usr/lib/xorg/protocol-precise.txt', not allowed dpkg: error processing xserver-common-lts-saucy (--remove):  subprocess installed post-removal script returned error exit status 2 Errors were encountered while processing:  xserver-common-lts-saucy E: Sub-process /usr/bin/dpkg returned an error code (1) Why is $\sqrt{-x}*\sqrt{-x}=-x?$ Software to read a QR code? I saw a  reading a book, but I don't have a smart phone to check it.    So I just took a picture of it and saved my PC. And I downloaded libdecoderqr0, libdecodeqr-dev, libdecodeqr-examples for reading it. But I don't know how to use it.    What do I do next, or is there a nicer way to read QR codes? Proof of property of abelian group I want to show that $\forall x$,$y\in G$, $(xy)^2=x^2y^2 \iff G $ is an abelian group.  Proof of the backward direction seems easy enough:  Assume $G$ is an abelian group. Then consider $(xy)^2=(xy)(xy)$. By associativity, $(xy)(xy)=xyxy$. Since $G$ is abelian, $xyxy=xxyy=x^2y^2$.   Proof of the forward direction I attempt by contrapositive:  That is, assume $G$ is not an abelian group. Then, consider $(xy)^2=xyxy$ as above. Yet, $xyxy\neq xxyy=x^2y^2$ since we no longer have commutativity.  Is this proof by contrapositive completely correct? Algorithm to return all combinations of k elements from n "Prometheus" is meant to be a prequel to "Alien", happening 30 years before ().  If that's the case, how come one of the very earliest spaceships, Prometheus from 2089, has a spiffy new technology, while Nostromo has antique text based CRTs, mechanical IBM style keyboards, and all the associated technologies screaming "1980s called, and they want their IBM PC back!" ?  The great visuals of this can be seen in this Youtube Video  (ignore the russian voice-over - the guy is a movie critic who is complaining pretty much of the same discrepancy listed above).  Please note that I'm looking ONLY for in-universe answers (movies, scripts, explanations from creative team). I'm utterly un-interested in the obvious out of universe "well, for 1979 Alien film, 1980s technologies was the future, and 2012 movie is expected to look futuristic in 2012, duh" or speculations that make sense but aren't confirmed in canon.          And for those who don't believe me... to quote the immortal quip from Men in Black 2:   Old and busted:        New hotness: I'm trying to decide on a higher-end digital SLR, and I'm down to choosing between an APS-C model and a full-frame model.  I understand that the sensors are of different sizes, and as such have an effect on the perceived magnification of the lens, with the smaller APS-C sensor having an effective focal length greater than what it otherwise would be with a full frame sensor. But why does this matter?     What things should drive my choice between one or the other?   In which situations is one better than the other, and why? Self Teaching QFT I am currently in the process of teaching myself QFT.  It is not an easy task.  I have armed myself with many of the standard textbooks.  However, I am slow learner.   I get stuck on a thousand different terms which I don't understand, and a style of 'mathematics speak'  which loses me 95% of the time.   There are so many gaps in my knowledge that if I were a ship I would be at the bottom of the ocean.  What I really need is a book called 'QFT for Morons'. That's a bit harsh but 'QFT for dummies' doesn't quite express it clearly enough and besides there isn't such a book as far as I can find.  Any suggestions of resources or books that might help?   What I am really looking for is the one that explains QFT like you were talking to a five year old.  Perhaps I am asking the impossible.  I will add a bit more of a specific question here.    I have learnt that there are groups and non-abelian Lie groups like SU(2) etc., and then there a lagrangians, as well as a few other things like operators and states.   So a really dumb question is how are the lagrangians derived?  Are they determined by the group?  I am also confused because I understand some of the groups like SU(3) are used for different things in QFT.   I feel compelled to appologize for my ignorance but I am determined to make so more progress with this.   The problem when one is teaching oneself is you don't know which is the most fruitful path to follow. Can an integrity check be run against a USB boot disk?