I'm reading the book about moduli spaces by Huybrechts and Lehn, and i'm stuck understanding a proof, it is Theorem 6.1.8.:

Given a K3-surface $X$ and a 2-dimensional space $M$, coherent and torsion free sheafs $F$ on $X$ and $E$ on $M\times X$. We have projections $p,q$ from $M\times X$ to $M$ and $X$ resp.

They claim the class $a:=ch(p_{\*}\mathcal{H}om(q^{\*}F,E))$ as an element in $H^{\*}(M,\mathbb{Q})$, where $p_{\*}\mathcal{H}om(q^{\*}F,E)=\sum\limits_{i=0}^2 (-1)^i \mathcal{E}xt^i_p(q^{\*}F,E)$, only depends on the classes of $ch(q^{\*}F)$ and $ch(E)$ as elements in $H^{\*}(M\times X,\mathbb{Q})$, where $\mathcal{E}xt_p^i(q^{\*}F,E)=R^i(p_{\*}\mathcal{H}om(q^{\*}F,E))$.

So using Grothendieck-Riemann-Roch as suggested shows: $ch(\sum\limits_{i=0}^2 (-1)^i \mathcal{E}xt^i_p(q^{\*}F,E))td(M)=p_{\*}(ch(\mathcal{H}om(q^{\*}F,E)td(M\times X))$

Here i am stuck. Why does this show that $a$ only depends on $ch(E)$ and $ch(q^{\*}F)$. I think one has to show that $ch(\mathcal{H}om(q^{\*}F,E))$ only depends on this classes, but i can't see why.