Strange but it works with same principle I was trying to. Maybe I had some grammer error. Here is a code if somebody will need it in future as there was nothing in search result:
// get product media library
$mediaArgs = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'numberposts' => -1,
'post_status' => null,
'post_parent' => $current_post, // any parent
);
$MediaAttachments = get_posts($mediaArgs);
$parentMediaArray = array();
foreach ($MediaAttachments as $MediaAttachment) {
$parentMediaArray[] = $MediaAttachment->ID;
}
// get ALL the media library exept that I'm using now
$mediaArgs2 = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'numberposts' => -1,
'post_status' => null,
'exclude' => $parentMediaArray,
'post_parent' => 'any', // any parent
);
$MediaAttachmentsALL = get_posts($mediaArgs2);
Where $parentMediaArray
is the array which I exclude