Yes, it looks like this is the case for Pigs as well as Sheep and Dinosaurs.
From the Animals wikia page:
Warning: Sheep, Pigs, and Dinosaurs at a high enough mood and friendship will NOT PRODUCE ANYTHING because they will always roll a "Large/Deluxe product", and the animal type cannot produce Large or Deluxe products
Thus, in order to optimize how many Truffles your Pig produces, you want to keep its mood and friendship between 70 and 200. This is because if your Pig's mood is below 70, there is a chance that it will not produce anything:
If the animal has less than 70 Mood, there is a chance it will not produce. The lower the mood, the less likely it will produce. (The percent chance it will still produce is equal to Mood/70)
The reason that you do not want your Pig to have 200 or higher mood is because having 200-255 mood will greatly increase your Pig's chance to produce a "large/deluxe" item. From the same page as above:
A "Mood Modifier" is calculated when rolling for whether Deluxe produce (Large products, Duck Feathers, and Rabbit feet) will be created in the following ways:
- If Mood is more than 200, it will be multiplied by 2
- If Mood is 200 or less, it will be multiplied by Negative 2
Thus, you want your Pig's mood to surpass 70 in order to guarantee truffle production, but keep it under 200 to prevent its likelihood of producing a large/deluxe truffle (because it is unable to do so).