Yes but the japanese law is really old fashioned, it forbid an adult to "Cause a child to commit an obscene act" (child welfare act, article 34, VI)
There's a major loophole in the law; as long as it's the child who initiates the obscene act, it's legal.