It's a Bit of a Stretch․․․

Jelly, 9 bytes

BmxJ$mḄð€

Try it online!

-1 for left, 1 for right.


Python 2, 102 96 bytes

lambda d,n:[int(''.join(c*-~i for i,c in enumerate(bin(x+1)[2:][::d]))[::d],2)for x in range(n)]

-1 for left, 1 for right

Try it online!


05AB1E, 14 13 bytes

Saved 1 byte thanks to Erik the Outgolfer

LbεIiRƶRëƶ}JC

1 for left.
0 (or anything else) for right.

Try it online!

Explanation

L                # push range [1 ... first_input]
 b               # convert to binary
  ε              # apply to each
   Ii            # if second_input is true
     RƶR         # reverse, multiply each element with its 1-based index and reverse again
        ëƶ       # else, multiply each element with its 1-based index
          }      # end if
           J     # join
            C    # convert to base-10